summaryrefslogtreecommitdiff
path: root/lisp/ediff-vers.el
diff options
context:
space:
mode:
authorMichael Kifer <kifer@cs.stonybrook.edu>2003-01-25 08:09:16 +0000
committerMichael Kifer <kifer@cs.stonybrook.edu>2003-01-25 08:09:16 +0000
commit182ab9d3a7b33ee9175a6ca8732a2504a8a128df (patch)
tree3f08c1910f5ec0c14d236328d6a414e899b366cd /lisp/ediff-vers.el
parente035eee16073609aac36241bb9ffeb68efe87869 (diff)
downloademacs-182ab9d3a7b33ee9175a6ca8732a2504a8a128df.tar.gz
2003-01-25 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff.el (ediff-revision): better defaults. * ediff-vers.el (ediff-vc-latest-version): new function. (ediff-vc-internal): use latest version instead of working version.
Diffstat (limited to 'lisp/ediff-vers.el')
-rw-r--r--lisp/ediff-vers.el24
1 files changed, 20 insertions, 4 deletions
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el
index 88d4ea16d7b..03bc171a657 100644
--- a/lisp/ediff-vers.el
+++ b/lisp/ediff-vers.el
@@ -52,12 +52,28 @@
;; end pacifier
;; VC.el support
+
+(defun ediff-vc-latest-version (file)
+ "Return the version level of the latest version of FILE in repository."
+ (if (fboundp 'vc-latest-version)
+ (vc-latest-version file)
+ (or (vc-file-getprop file 'vc-latest-version)
+ (cond ((vc-backend file)
+ (vc-call state file)
+ (vc-file-getprop file 'vc-latest-version))
+ (t (error "File %s is not under version control" file))))
+ ))
+
+
(defun ediff-vc-internal (rev1 rev2 &optional startup-hooks)
-;; Run Ediff on versions of the current buffer.
-;; If REV2 is "" then compare current buffer with REV1.
-;; If the current buffer is named `F', the version is named `F.~REV~'.
-;; If `F.~REV~' already exists, it is used instead of being re-created.
+ ;; Run Ediff on versions of the current buffer.
+ ;; If REV1 is "", use the latest version of the current buffer's file.
+ ;; If REV2 is "" then compare current buffer with REV1.
+ ;; If the current buffer is named `F', the version is named `F.~REV~'.
+ ;; If `F.~REV~' already exists, it is used instead of being re-created.
(let (file1 file2 rev1buf rev2buf)
+ (if (string= rev1 "")
+ (setq rev1 (ediff-vc-latest-version (buffer-file-name))))
(save-window-excursion
(save-excursion
(vc-version-other-window rev1)