52 |
;; end pacifier |
;; end pacifier |
53 |
|
|
54 |
;; VC.el support |
;; VC.el support |
55 |
|
|
56 |
|
(defun ediff-vc-latest-version (file) |
57 |
|
"Return the version level of the latest version of FILE in repository." |
58 |
|
(if (fboundp 'vc-latest-version) |
59 |
|
(vc-latest-version file) |
60 |
|
(or (vc-file-getprop file 'vc-latest-version) |
61 |
|
(cond ((vc-backend file) |
62 |
|
(vc-call state file) |
63 |
|
(vc-file-getprop file 'vc-latest-version)) |
64 |
|
(t (error "File %s is not under version control" file)))) |
65 |
|
)) |
66 |
|
|
67 |
|
|
68 |
(defun ediff-vc-internal (rev1 rev2 &optional startup-hooks) |
(defun ediff-vc-internal (rev1 rev2 &optional startup-hooks) |
69 |
;; Run Ediff on versions of the current buffer. |
;; Run Ediff on versions of the current buffer. |
70 |
;; If REV2 is "" then compare current buffer with REV1. |
;; If REV1 is "", use the latest version of the current buffer's file. |
71 |
;; If the current buffer is named `F', the version is named `F.~REV~'. |
;; If REV2 is "" then compare current buffer with REV1. |
72 |
;; If `F.~REV~' already exists, it is used instead of being re-created. |
;; If the current buffer is named `F', the version is named `F.~REV~'. |
73 |
|
;; If `F.~REV~' already exists, it is used instead of being re-created. |
74 |
(let (file1 file2 rev1buf rev2buf) |
(let (file1 file2 rev1buf rev2buf) |
75 |
|
(if (string= rev1 "") |
76 |
|
(setq rev1 (ediff-vc-latest-version (buffer-file-name)))) |
77 |
(save-window-excursion |
(save-window-excursion |
78 |
(save-excursion |
(save-excursion |
79 |
(vc-version-other-window rev1) |
(vc-version-other-window rev1) |