+2014-12-14 Dmitry Gutov <dgutov@yandex.ru>
+
+ Move ASYNC argument to the `diff' VC command to the fifth
+ position, for better compatibility with existing third-party code,
+ and document it.
+
+ * vc/vc.el (vc-diff-internal): Pass `async' argument to the
+ backend `diff' command in the last position.
+
+ * vc/vc-svn.el (vc-svn-diff):
+ * vc/vc-src.el (vc-src-diff):
+ * vc/vc-sccs.el (vc-sccs-diff):
+ * vc/vc-rcs.el (vc-rcs-diff):
+ * vc/vc-mtn.el (vc-mtn-diff):
+ * vc/vc-hg.el (vc-hg-diff):
+ * vc/vc-git.el (vc-git-diff):
+ * vc/vc-dav.el (vc-dav-diff):
+ * vc/vc-cvs.el (vc-cvs-diff):
+ * vc/vc-bzr.el (vc-bzr-diff):
+ * obsolete/vc-arch.el (vc-arch-diff): Move ASYNC argument to the end.
+
2014-12-13 Andreas Schwab <schwab@linux-m68k.org>
* net/shr.el (shr-next-link): Don't error out at eob.
(vc-arch-command nil 0 files "commit" "-s" summary "-L" comment "--"
(vc-switches 'Arch 'checkin))))
-(defun vc-arch-diff (files &optional async oldvers newvers buffer)
+(defun vc-arch-diff (files &optional oldvers newvers buffer async)
"Get a difference report using Arch between two versions of FILES."
;; FIXME: This implementation only works for singleton filesets. To make
;; it work for more cases, we have to either call `file-diffs' manually on
(autoload 'vc-switches "vc")
-(defun vc-bzr-diff (files &optional async rev1 rev2 buffer)
+(defun vc-bzr-diff (files &optional rev1 rev2 buffer async)
"VC bzr backend for diff."
(let* ((switches (vc-switches 'bzr 'diff))
(args
(autoload 'vc-version-backup-file "vc")
(declare-function vc-coding-system-for-diff "vc" (file))
-(defun vc-cvs-diff (files &optional async oldvers newvers buffer)
+(defun vc-cvs-diff (files &optional oldvers newvers buffer async)
"Get a difference report using CVS between two revisions of FILE."
(let* (process-file-side-effects
(async (and async (vc-cvs-stay-local-p files)))
"Insert the revision log of URL into the *vc* buffer."
)
-(defun vc-dav-diff (url &optional async rev1 rev2)
+(defun vc-dav-diff (url &optional rev1 rev2 buffer async)
"Insert the diff for URL into the *vc-diff* buffer.
If REV1 and REV2 are non-nil report differences from REV1 to REV2.
If REV1 is nil, use the current workfile version as the older version.
;; - show-log-entry (revision) OK
;; - comment-history (file) ??
;; - update-changelog (files) COULD BE SUPPORTED
-;; * diff (file &optional rev1 rev2 buffer) OK
+;; * diff (file &optional rev1 rev2 buffer async) OK
;; - revision-completion-table (files) OK
;; - annotate-command (file buf &optional rev) OK
;; - annotate-time () OK
(autoload 'vc-switches "vc")
-(defun vc-git-diff (files &optional async rev1 rev2 buffer)
+(defun vc-git-diff (files &optional rev1 rev2 buffer async)
"Get a difference report using Git between two revisions of FILES."
(let (process-file-side-effects)
(if vc-git-diff-switches
(autoload 'vc-switches "vc")
-(defun vc-hg-diff (files &optional async oldvers newvers buffer)
+(defun vc-hg-diff (files &optional oldvers newvers buffer async)
"Get a difference report using hg between two revisions of FILES."
(let* ((firstfile (car files))
(working (and firstfile (vc-working-revision firstfile))))
(autoload 'vc-switches "vc")
-(defun vc-mtn-diff (files &optional async rev1 rev2 buffer)
+(defun vc-mtn-diff (files &optional rev1 rev2 buffer async)
"Get a difference report using monotone between two revisions of FILES."
(apply 'vc-mtn-command (or buffer "*vc-diff*")
(if async 'async 1)
(vc-rcs-print-log-cleanup))
(when limit 'limit-unsupported))
-(defun vc-rcs-diff (files &optional async oldvers newvers buffer)
+(defun vc-rcs-diff (files &optional oldvers newvers buffer async)
"Get a difference report using RCS between two sets of files."
(apply #'vc-do-command (or buffer "*vc-diff*")
(if async 'async 1)
(defvar w32-quote-process-args)
;; FIXME use sccsdiff if present?
-(defun vc-sccs-diff (files &optional _async oldvers newvers buffer)
+(defun vc-sccs-diff (files &optional oldvers newvers buffer _async)
"Get a difference report using SCCS between two filesets."
(setq files (vc-expand-dirs files 'SCCS))
(setq oldvers (vc-sccs-lookup-triple (car files) oldvers))
(when limit (list "-l" (format "%s" limit)))
vc-src-log-switches)))))
-(defun vc-src-diff (files &optional _async oldvers newvers buffer)
+(defun vc-src-diff (files &optional oldvers newvers buffer _async)
"Get a difference report using src between two revisions of FILES."
(let* ((firstfile (car files))
(working (and firstfile (vc-working-revision firstfile))))
(if start-revision (format "-r%s" start-revision) "-rHEAD:0"))
(when limit (list "--limit" (format "%s" limit)))))))))
-(defun vc-svn-diff (files &optional async oldvers newvers buffer)
+(defun vc-svn-diff (files &optional oldvers newvers buffer async)
"Get a difference report using SVN between two revisions of fileset FILES."
(and oldvers
(not newvers)
;; default implementation runs rcs2log, which handles RCS- and
;; CVS-style logs.
;;
-;; * diff (files &optional async rev1 rev2 buffer)
+;; * diff (files &optional rev1 rev2 buffer async)
;;
;; Insert the diff for FILE into BUFFER, or the *vc-diff* buffer if
-;; BUFFER is nil. If ASYNC is non-nil, run asynchronously.If REV1
+;; BUFFER is nil. If ASYNC is non-nil, run asynchronously. If REV1
;; and REV2 are non-nil, report differences from REV1 to REV2. If
;; REV1 is nil, use the working revision (as found in the
;; repository) as the older revision; if REV2 is nil, use the
;; revision been even possible, let alone sane.
;;
;; INCOMPATIBLE CHANGE: In older versions of the API, vc-diff did
-;; not take an async-mode flag as a first optional argument. (This
+;; not take an async-mode flag as a fourth optional argument. (This
;; change eliminated a particularly ugly global.)
;;
;; - INCOMPATIBLE CHANGE: The backend operation for non-distributed
(if async 'async 1) "diff" file
(append (vc-switches nil 'diff) '("/dev/null"))))))
(setq files (nreverse filtered))))
- (vc-call-backend (car vc-fileset) 'diff files async rev1 rev2 buffer)
+ (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async)
(set-buffer buffer)
(diff-mode)
(set (make-local-variable 'diff-vc-backend) (car vc-fileset))