Function: vc-version-ediff

vc-version-ediff is an autoloaded, interactive and byte-compiled function defined in vc.el.gz.

Signature

(vc-version-ediff FILES REV1 REV2)

Documentation

Show differences between REV1 and REV2 of FILES using ediff.

This compares two revisions of the files in FILES. Currently, only a single file's revisions can be compared, i.e. FILES can specify only one file name. If REV1 is nil, it defaults to the current revision, i.e. revision of the last commit. If REV2 is nil, it defaults to the work tree, i.e. the current state of each file in FILES.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;;;###autoload
(defun vc-version-ediff (files rev1 rev2)
  "Show differences between REV1 and REV2 of FILES using ediff.
This compares two revisions of the files in FILES.  Currently,
only a single file's revisions can be compared, i.e. FILES can
specify only one file name.
If REV1 is nil, it defaults to the current revision, i.e. revision
of the last commit.
If REV2 is nil, it defaults to the work tree, i.e. the current
state of each file in FILES."
  (interactive (vc-diff-build-argument-list-internal))
  ;; All that was just so we could do argument completion!
  (when (and (not rev1) rev2)
    (error "Not a valid revision range"))

  (message "%s" (format "Finding changes in %s..." (vc-delistify files)))

  ;; Functions ediff-(vc|rcs)-internal use "" instead of nil.
  (when (null rev1) (setq rev1 ""))
  (when (null rev2) (setq rev2 ""))

  (cond
   ;; FIXME We only support running ediff on one file for now.
   ;; We could spin off an ediff session per file in the file set.
   ((= (length files) 1)
    (require 'ediff)
    (ediff-load-version-control)  ; loads ediff-vers
    (find-file (car files))             ;FIXME: find-file from Elisp is bad.
    (ediff-vc-internal rev1 rev2 nil))
   (t
    (error "More than one file is not supported"))))