aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-05-09 16:41:26 +0000
committerStefan Monnier2008-05-09 16:41:26 +0000
commita749e19d070f015f11d6e4b7fad2841d4b0df358 (patch)
tree12a09c163dcd14b6892f1f191f8972487bdf6c50
parente7290559824406d111d306069b36dde8ced847f9 (diff)
downloademacs-a749e19d070f015f11d6e4b7fad2841d4b0df358.tar.gz
emacs-a749e19d070f015f11d6e4b7fad2841d4b0df358.zip
* vc.el (vc-mark-resolved): Add `backend' argument.
(vc-next-action): Pass it the backend. (vc-next-action, vc-checkout, vc-mark-resolved, vc-version-diff) (vc-merge, vc-rollback, vc-update, vc-transfer-file, vc-delete-file) (vc-default-comment-history, vc-default-create-snapshot) (vc-default-retrieve-snapshot, vc-default-revert, vc-annotate) (vc-annotate-revision-previous-to-line) (vc-annotate-show-diff-revision-at-line, vc-annotate-warp-revision): * vc-svn.el (vc-svn-checkout): * vc-mcvs.el (vc-mcvs-checkout): * vc-hooks.el (vc-state, vc-default-workfile-unchanged-p) (vc-working-revision, vc-before-save, vc-mode-line): Prefer vc-call-backend to vc-call so as not to recompute the backend.
-rw-r--r--lisp/ChangeLog21
-rw-r--r--lisp/vc-hooks.el27
-rw-r--r--lisp/vc-mcvs.el2
-rw-r--r--lisp/vc-svn.el2
-rw-r--r--lisp/vc.el110
5 files changed, 95 insertions, 67 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bc21788653b..4b2d890ae41 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,12 +1,25 @@
12008-05-09 Eric S. Raymond <esr@snark.thyrsus.com> 12008-05-09 Eric S. Raymond <esr@snark.thyrsus.com>
2 2
3 * vc-scs.el (vc-sccs-checkin, vc-sccs-checkout, vc-sccs-rollback, 3 * vc-scs.el (vc-sccs-checkin, vc-sccs-checkout, vc-sccs-rollback)
4 vc-sccs-revert, vc-sccs-steal-lock, vc-sccs-modify-change-comment, 4 (vc-sccs-revert, vc-sccs-steal-lock, vc-sccs-modify-change-comment)
5 vc-sccs-print-log, vc-sccs-diff): Teach SCCS back end to grok 5 (vc-sccs-print-log, vc-sccs-diff): Grok directories.
6 directories.
7 6
82008-05-09 Stefan Monnier <monnier@iro.umontreal.ca> 72008-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
9 8
9 * vc.el (vc-mark-resolved): Add `backend' argument.
10 (vc-next-action): Pass it the backend.
11 (vc-next-action, vc-checkout, vc-mark-resolved, vc-version-diff)
12 (vc-merge, vc-rollback, vc-update, vc-transfer-file, vc-delete-file)
13 (vc-default-comment-history, vc-default-create-snapshot)
14 (vc-default-retrieve-snapshot, vc-default-revert, vc-annotate)
15 (vc-annotate-revision-previous-to-line)
16 (vc-annotate-show-diff-revision-at-line, vc-annotate-warp-revision):
17 * vc-svn.el (vc-svn-checkout):
18 * vc-mcvs.el (vc-mcvs-checkout):
19 * vc-hooks.el (vc-state, vc-default-workfile-unchanged-p)
20 (vc-working-revision, vc-before-save, vc-mode-line):
21 Prefer vc-call-backend to vc-call so as not to recompute the backend.
22
10 * vc.el (vc-deduce-fileset): Don't require the checkout-model and the 23 * vc.el (vc-deduce-fileset): Don't require the checkout-model and the
11 state to be consistent since it's often an unwarranted restriction. 24 state to be consistent since it's often an unwarranted restriction.
12 Don't return the state either. 25 Don't return the state either.
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 86cce60f27f..926027bdff3 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -539,9 +539,12 @@ status of this file."
539 ;; - `removed' 539 ;; - `removed'
540 ;; - `copied' and `moved' (might be handled by `removed' and `added') 540 ;; - `copied' and `moved' (might be handled by `removed' and `added')
541 (or (vc-file-getprop file 'vc-state) 541 (or (vc-file-getprop file 'vc-state)
542 (when (and (> (length file) 0) (vc-backend file)) 542 (when (> (length file) 0)
543 (vc-file-setprop file 'vc-state 543 (let ((backend (vc-backend file)))
544 (vc-call state-heuristic file))))) 544 (when backend
545 (vc-file-setprop
546 file 'vc-state
547 (vc-call-backend backend 'state-heuristic file)))))))
545 548
546(defun vc-recompute-state (file) 549(defun vc-recompute-state (file)
547 "Recompute the version control state of FILE, and return it. 550 "Recompute the version control state of FILE, and return it.
@@ -577,26 +580,26 @@ Return non-nil if FILE is unchanged."
577 (zerop (condition-case err 580 (zerop (condition-case err
578 ;; If the implementation supports it, let the output 581 ;; If the implementation supports it, let the output
579 ;; go to *vc*, not *vc-diff*, since this is an internal call. 582 ;; go to *vc*, not *vc-diff*, since this is an internal call.
580 (vc-call diff (list file) nil nil "*vc*") 583 (vc-call-backend backend 'diff (list file) nil nil "*vc*")
581 (wrong-number-of-arguments 584 (wrong-number-of-arguments
582 ;; If this error came from the above call to vc-BACKEND-diff, 585 ;; If this error came from the above call to vc-BACKEND-diff,
583 ;; try again without the optional buffer argument (for 586 ;; try again without the optional buffer argument (for
584 ;; backward compatibility). Otherwise, resignal. 587 ;; backward compatibility). Otherwise, resignal.
585 (if (or (not (eq (cadr err) 588 (if (or (not (eq (cadr err)
586 (indirect-function 589 (indirect-function
587 (vc-find-backend-function (vc-backend file) 590 (vc-find-backend-function backend 'diff))))
588 'diff))))
589 (not (eq (caddr err) 4))) 591 (not (eq (caddr err) 4)))
590 (signal (car err) (cdr err)) 592 (signal (car err) (cdr err))
591 (vc-call diff (list file))))))) 593 (vc-call-backend backend 'diff (list file)))))))
592 594
593(defun vc-working-revision (file) 595(defun vc-working-revision (file)
594 "Return the repository version from which FILE was checked out. 596 "Return the repository version from which FILE was checked out.
595If FILE is not registered, this function always returns nil." 597If FILE is not registered, this function always returns nil."
596 (or (vc-file-getprop file 'vc-working-revision) 598 (or (vc-file-getprop file 'vc-working-revision)
597 (when (vc-backend file) 599 (let ((backend (vc-backend file)))
598 (vc-file-setprop file 'vc-working-revision 600 (when backend
599 (vc-call working-revision file))))) 601 (vc-file-setprop file 'vc-working-revision
602 (vc-call-backend backend 'working-revision file))))))
600 603
601;; Backward compatibility. 604;; Backward compatibility.
602(define-obsolete-function-alias 605(define-obsolete-function-alias
@@ -746,7 +749,7 @@ Before doing that, check if there are any old backups and get rid of them."
746 (and (setq backend (vc-backend file)) 749 (and (setq backend (vc-backend file))
747 (vc-up-to-date-p file) 750 (vc-up-to-date-p file)
748 (eq (vc-checkout-model backend (list file)) 'implicit) 751 (eq (vc-checkout-model backend (list file)) 'implicit)
749 (vc-call make-version-backups-p file) 752 (vc-call-backend backend 'make-version-backups-p file)
750 (vc-make-version-backup file))))) 753 (vc-make-version-backup file)))))
751 754
752(declare-function vc-directory-resynch-file "vc" (file)) 755(declare-function vc-directory-resynch-file "vc" (file))
@@ -798,7 +801,7 @@ visiting FILE."
798 (let ((backend (vc-backend file))) 801 (let ((backend (vc-backend file)))
799 (if (not backend) 802 (if (not backend)
800 (setq vc-mode nil) 803 (setq vc-mode nil)
801 (let* ((ml-string (vc-call mode-line-string file)) 804 (let* ((ml-string (vc-call-backend backend 'mode-line-string file))
802 (ml-echo (get-text-property 0 'help-echo ml-string))) 805 (ml-echo (get-text-property 0 'help-echo ml-string)))
803 (setq vc-mode 806 (setq vc-mode
804 (concat 807 (concat
diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el
index 9eb91503089..7bef11c2401 100644
--- a/lisp/vc-mcvs.el
+++ b/lisp/vc-mcvs.el
@@ -312,7 +312,7 @@ This is only possible if Meta-CVS is responsible for FILE's directory.")
312(defun vc-mcvs-checkout (file &optional editable rev) 312(defun vc-mcvs-checkout (file &optional editable rev)
313 (message "Checking out %s..." file) 313 (message "Checking out %s..." file)
314 (with-current-buffer (or (get-file-buffer file) (current-buffer)) 314 (with-current-buffer (or (get-file-buffer file) (current-buffer))
315 (vc-call update file editable rev (vc-switches 'MCVS 'checkout))) 315 (vc-mcvs-update file editable rev (vc-switches 'MCVS 'checkout)))
316 (vc-mode-line file) 316 (vc-mode-line file)
317 (message "Checking out %s...done" file)) 317 (message "Checking out %s...done" file))
318 318
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index b08f050fd55..49c4c4153e6 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -271,7 +271,7 @@ This is only possible if SVN is responsible for FILE's directory.")
271(defun vc-svn-checkout (file &optional editable rev) 271(defun vc-svn-checkout (file &optional editable rev)
272 (message "Checking out %s..." file) 272 (message "Checking out %s..." file)
273 (with-current-buffer (or (get-file-buffer file) (current-buffer)) 273 (with-current-buffer (or (get-file-buffer file) (current-buffer))
274 (vc-call update file editable rev (vc-switches 'SVN 'checkout))) 274 (vc-svn-update file editable rev (vc-switches 'SVN 'checkout)))
275 (vc-mode-line file) 275 (vc-mode-line file)
276 (message "Checking out %s...done" file)) 276 (message "Checking out %s...done" file))
277 277
diff --git a/lisp/vc.el b/lisp/vc.el
index 8c8394e6fa9..052ee7ce9e1 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1193,7 +1193,12 @@ merge in the changes into your working copy."
1193 state))) 1193 state)))
1194 ;; conflict 1194 ;; conflict
1195 ((eq state 'conflict) 1195 ((eq state 'conflict)
1196 (vc-mark-resolved files)) 1196 ;; FIXME: Is it really the UI we want to provide?
1197 ;; In my experience, the conflicted files should be marked as resolved
1198 ;; one-by-one when saving the file after resolving the conflicts.
1199 ;; I.e. stating explicitly that the conflicts are resolved is done
1200 ;; very rarely.
1201 (vc-mark-resolved backend files))
1197 ;; needs-update 1202 ;; needs-update
1198 ((eq state 'needs-update) 1203 ((eq state 'needs-update)
1199 (dolist (file files) 1204 (dolist (file files)
@@ -1210,7 +1215,8 @@ merge in the changes into your working copy."
1210 (when (yes-or-no-p (format 1215 (when (yes-or-no-p (format
1211 "%s is not up-to-date. Merge in changes now? " 1216 "%s is not up-to-date. Merge in changes now? "
1212 (file-name-nondirectory file))) 1217 (file-name-nondirectory file)))
1213 (vc-maybe-resolve-conflicts file (vc-call merge-news file))))) 1218 (vc-maybe-resolve-conflicts
1219 file (vc-call-backend backend 'merge-news file)))))
1214 1220
1215 ;; unlocked-changes 1221 ;; unlocked-changes
1216 ((eq state 'unlocked-changes) 1222 ((eq state 'unlocked-changes)
@@ -1228,7 +1234,7 @@ merge in the changes into your working copy."
1228 (not (beep)) 1234 (not (beep))
1229 (yes-or-no-p (concat "File has unlocked changes. " 1235 (yes-or-no-p (concat "File has unlocked changes. "
1230 "Claim lock retaining changes? "))) 1236 "Claim lock retaining changes? ")))
1231 (progn (vc-call steal-lock file) 1237 (progn (vc-call-backend backend 'steal-lock file)
1232 (clear-visited-file-modtime) 1238 (clear-visited-file-modtime)
1233 ;; Must clear any headers here because they wouldn't 1239 ;; Must clear any headers here because they wouldn't
1234 ;; show that the file is locked now. 1240 ;; show that the file is locked now.
@@ -1340,7 +1346,7 @@ After check-out, runs the normal hook `vc-checkout-hook'."
1340 (signal (car err) (cdr err)))) 1346 (signal (car err) (cdr err))))
1341 `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit) 1347 `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit)
1342 (not writable)) 1348 (not writable))
1343 (if (vc-call latest-on-branch-p file) 1349 (if (vc-call-backend backend 'latest-on-branch-p file)
1344 'up-to-date 1350 'up-to-date
1345 'needs-update) 1351 'needs-update)
1346 'edited)) 1352 'edited))
@@ -1348,10 +1354,10 @@ After check-out, runs the normal hook `vc-checkout-hook'."
1348 (vc-resynch-buffer file t t) 1354 (vc-resynch-buffer file t t)
1349 (run-hooks 'vc-checkout-hook)) 1355 (run-hooks 'vc-checkout-hook))
1350 1356
1351(defun vc-mark-resolved (files) 1357(defun vc-mark-resolved (backend files)
1352 (with-vc-properties 1358 (with-vc-properties
1353 files 1359 files
1354 (vc-call mark-resolved files) 1360 (vc-call-backend backend 'mark-resolved files)
1355 ;; XXX: Is this TRTD? Might not be. 1361 ;; XXX: Is this TRTD? Might not be.
1356 `((vc-state . edited)))) 1362 `((vc-state . edited))))
1357 1363
@@ -1564,9 +1570,10 @@ returns t if the buffer had changes, nil otherwise."
1564 (interactive 1570 (interactive
1565 (let* ((vc-fileset (vc-deduce-fileset)) 1571 (let* ((vc-fileset (vc-deduce-fileset))
1566 (files (cdr vc-fileset)) 1572 (files (cdr vc-fileset))
1573 (backend (car vc-fileset))
1567 (first (car files)) 1574 (first (car files))
1568 (completion-table 1575 (completion-table
1569 (vc-call revision-completion-table files)) 1576 (vc-call-backend backend 'revision-completion-table files))
1570 (rev1-default nil) 1577 (rev1-default nil)
1571 (rev2-default nil)) 1578 (rev2-default nil))
1572 (cond 1579 (cond
@@ -1582,8 +1589,8 @@ returns t if the buffer had changes, nil otherwise."
1582 (setq rev1-default (vc-working-revision first))) 1589 (setq rev1-default (vc-working-revision first)))
1583 ;; if the file is not locked, use last and previous revisions as defaults 1590 ;; if the file is not locked, use last and previous revisions as defaults
1584 (t 1591 (t
1585 (setq rev1-default (vc-call previous-revision first 1592 (setq rev1-default (vc-call-backend backend 'previous-revision first
1586 (vc-working-revision first))) 1593 (vc-working-revision first)))
1587 (when (string= rev1-default "") (setq rev1-default nil)) 1594 (when (string= rev1-default "") (setq rev1-default nil))
1588 (setq rev2-default (vc-working-revision first)))) 1595 (setq rev2-default (vc-working-revision first))))
1589 ;; construct argument list 1596 ;; construct argument list
@@ -1774,9 +1781,7 @@ See Info node `Merging'."
1774 (read-string (concat "Branch or revision to merge from " 1781 (read-string (concat "Branch or revision to merge from "
1775 "(default news on current branch): "))) 1782 "(default news on current branch): ")))
1776 (if (string= first-revision "") 1783 (if (string= first-revision "")
1777 (if (not (vc-find-backend-function backend 'merge-news)) 1784 (setq status (vc-call-backend backend 'merge-news file))
1778 (error "Sorry, merging news is not implemented for %s" backend)
1779 (setq status (vc-call merge-news file)))
1780 (if (not (vc-find-backend-function backend 'merge)) 1785 (if (not (vc-find-backend-function backend 'merge))
1781 (error "Sorry, merging is not implemented for %s" backend) 1786 (error "Sorry, merging is not implemented for %s" backend)
1782 (if (not (vc-branch-p first-revision)) 1787 (if (not (vc-branch-p first-revision))
@@ -1788,7 +1793,8 @@ See Info node `Merging'."
1788 (setq second-revision first-revision) 1793 (setq second-revision first-revision)
1789 ;; first-revision must be the starting point of the branch 1794 ;; first-revision must be the starting point of the branch
1790 (setq first-revision (vc-branch-part first-revision))) 1795 (setq first-revision (vc-branch-part first-revision)))
1791 (setq status (vc-call merge file first-revision second-revision)))) 1796 (setq status (vc-call-backend backend 'merge file
1797 first-revision second-revision))))
1792 (vc-maybe-resolve-conflicts file status "WORKFILE" "MERGE SOURCE"))) 1798 (vc-maybe-resolve-conflicts file status "WORKFILE" "MERGE SOURCE")))
1793 1799
1794(defun vc-maybe-resolve-conflicts (file status &optional name-A name-B) 1800(defun vc-maybe-resolve-conflicts (file status &optional name-A name-B)
@@ -2192,7 +2198,8 @@ depending on the underlying version-control system."
2192 (error "Rollback is not supported in %s" backend)) 2198 (error "Rollback is not supported in %s" backend))
2193 (when (and (not (eq granularity 'repository)) (/= (length files) 1)) 2199 (when (and (not (eq granularity 'repository)) (/= (length files) 1))
2194 (error "Rollback requires a singleton fileset or repository versioning")) 2200 (error "Rollback requires a singleton fileset or repository versioning"))
2195 (when (not (vc-call latest-on-branch-p (car files))) 2201 ;; FIXME: latest-on-branch-p should take the fileset.
2202 (when (not (vc-call-backend backend 'latest-on-branch-p (car files)))
2196 (error "Rollback is only possible at the tip revision.")) 2203 (error "Rollback is only possible at the tip revision."))
2197 ;; If any of the files is visited by the current buffer, make 2204 ;; If any of the files is visited by the current buffer, make
2198 ;; sure buffer is saved. If the user says `no', abort since 2205 ;; sure buffer is saved. If the user says `no', abort since
@@ -2210,7 +2217,9 @@ depending on the underlying version-control system."
2210 (not-modified) 2217 (not-modified)
2211 (message "Finding changes...") 2218 (message "Finding changes...")
2212 (let* ((tip (vc-working-revision (car files))) 2219 (let* ((tip (vc-working-revision (car files)))
2213 (previous (vc-call previous-revision (car files) tip))) 2220 ;; FIXME: `previous-revision' should take the fileset.
2221 (previous (vc-call-backend backend 'previous-revision
2222 (car files) tip)))
2214 (vc-diff-internal nil vc-fileset previous tip)) 2223 (vc-diff-internal nil vc-fileset previous tip))
2215 ;; Display changes 2224 ;; Display changes
2216 (unless (yes-or-no-p "Discard these revisions? ") 2225 (unless (yes-or-no-p "Discard these revisions? ")
@@ -2257,10 +2266,8 @@ changes from the current branch are merged into the working file."
2257 (vc-state file) 2266 (vc-state file)
2258 (substitute-command-keys 2267 (substitute-command-keys
2259 "\\[vc-next-action] to correct"))) 2268 "\\[vc-next-action] to correct")))
2260 (if (not (vc-find-backend-function backend 'merge-news)) 2269 (vc-maybe-resolve-conflicts
2261 (error "Sorry, merging news is not implemented for %s" 2270 file (vc-call-backend backend 'merge-news file)))))))
2262 backend)
2263 (vc-maybe-resolve-conflicts file (vc-call merge-news file))))))))
2264 2271
2265(defun vc-version-backup-file (file &optional rev) 2272(defun vc-version-backup-file (file &optional rev)
2266 "Return name of backup file for revision REV of FILE. 2273 "Return name of backup file for revision REV of FILE.
@@ -2381,8 +2388,8 @@ backend to NEW-BACKEND, and unregister FILE from the current backend.
2381 (vc-file-setprop file 'vc-checkout-time nil))))) 2388 (vc-file-setprop file 'vc-checkout-time nil)))))
2382 (when move 2389 (when move
2383 (vc-switch-backend file old-backend) 2390 (vc-switch-backend file old-backend)
2384 (setq comment (vc-call comment-history file)) 2391 (setq comment (vc-call-backend old-backend 'comment-history file))
2385 (vc-call unregister file)) 2392 (vc-call-backend old-backend 'unregister file))
2386 (vc-switch-backend file new-backend) 2393 (vc-switch-backend file new-backend)
2387 (when (or move edited) 2394 (when (or move edited)
2388 (vc-file-setprop file 'vc-state 'edited) 2395 (vc-file-setprop file 'vc-state 'edited)
@@ -2446,7 +2453,7 @@ backend to NEW-BACKEND, and unregister FILE from the current backend.
2446 ;; command, kill the buffer created by the above 2453 ;; command, kill the buffer created by the above
2447 ;; `find-file-noselect' call. 2454 ;; `find-file-noselect' call.
2448 (unless buf (kill-buffer (current-buffer))))) 2455 (unless buf (kill-buffer (current-buffer)))))
2449 (vc-call delete-file file) 2456 (vc-call-backend backend 'delete-file file)
2450 ;; If the backend hasn't deleted the file itself, let's do it for him. 2457 ;; If the backend hasn't deleted the file itself, let's do it for him.
2451 (when (file-exists-p file) (delete-file file)) 2458 (when (file-exists-p file) (delete-file file))
2452 ;; Forget what VC knew about the file. 2459 ;; Forget what VC knew about the file.
@@ -2701,7 +2708,7 @@ to provide the `find-revision' operation instead."
2701 "Return a string with all log entries stored in BACKEND for FILE." 2708 "Return a string with all log entries stored in BACKEND for FILE."
2702 (when (vc-find-backend-function backend 'print-log) 2709 (when (vc-find-backend-function backend 'print-log)
2703 (with-current-buffer "*vc*" 2710 (with-current-buffer "*vc*"
2704 (vc-call print-log (list file)) 2711 (vc-call-backend backend 'print-log (list file))
2705 (vc-call-backend backend 'wash-log) 2712 (vc-call-backend backend 'wash-log)
2706 (buffer-string)))) 2713 (buffer-string))))
2707 2714
@@ -2718,7 +2725,7 @@ to provide the `find-revision' operation instead."
2718 (vc-file-tree-walk 2725 (vc-file-tree-walk
2719 dir 2726 dir
2720 (lambda (f) 2727 (lambda (f)
2721 (vc-call assign-name f name)))))) 2728 (vc-call-backend backend 'assign-name f name))))))
2722 2729
2723(defun vc-default-retrieve-snapshot (backend dir name update) 2730(defun vc-default-retrieve-snapshot (backend dir name update)
2724 (if (string= name "") 2731 (if (string= name "")
@@ -2728,7 +2735,7 @@ to provide the `find-revision' operation instead."
2728 (lambda (f) (and 2735 (lambda (f) (and
2729 (vc-up-to-date-p f) 2736 (vc-up-to-date-p f)
2730 (vc-error-occurred 2737 (vc-error-occurred
2731 (vc-call checkout f nil "") 2738 (vc-call-backend backend 'checkout f nil "")
2732 (when update (vc-resynch-buffer f t t))))))) 2739 (when update (vc-resynch-buffer f t t)))))))
2733 (let ((result (vc-snapshot-precondition dir))) 2740 (let ((result (vc-snapshot-precondition dir)))
2734 (if (stringp result) 2741 (if (stringp result)
@@ -2737,7 +2744,7 @@ to provide the `find-revision' operation instead."
2737 (vc-file-tree-walk 2744 (vc-file-tree-walk
2738 dir 2745 dir
2739 (lambda (f) (vc-error-occurred 2746 (lambda (f) (vc-error-occurred
2740 (vc-call checkout f nil name) 2747 (vc-call-backend backend 'checkout f nil name)
2741 (when update (vc-resynch-buffer f t t))))))))) 2748 (when update (vc-resynch-buffer f t t)))))))))
2742 2749
2743(defun vc-default-revert (backend file contents-done) 2750(defun vc-default-revert (backend file contents-done)
@@ -2759,7 +2766,8 @@ to provide the `find-revision' operation instead."
2759 ;; Change buffer to get local value of vc-checkout-switches. 2766 ;; Change buffer to get local value of vc-checkout-switches.
2760 (with-current-buffer file-buffer 2767 (with-current-buffer file-buffer
2761 (let ((default-directory (file-name-directory file))) 2768 (let ((default-directory (file-name-directory file)))
2762 (vc-call find-revision file rev outbuf))))) 2769 (vc-call-backend backend 'find-revision
2770 file rev outbuf)))))
2763 (setq failed nil)) 2771 (setq failed nil))
2764 (when backup-name 2772 (when backup-name
2765 (if failed 2773 (if failed
@@ -3015,18 +3023,20 @@ mode-specific menu. `vc-annotate-color-map' and
3015 ;; In case it had to be uniquified. 3023 ;; In case it had to be uniquified.
3016 (setq temp-buffer-name (buffer-name)))) 3024 (setq temp-buffer-name (buffer-name))))
3017 (with-output-to-temp-buffer temp-buffer-name 3025 (with-output-to-temp-buffer temp-buffer-name
3018 (vc-call annotate-command file (get-buffer temp-buffer-name) rev) 3026 (let ((backend (vc-backend file)))
3019 ;; we must setup the mode first, and then set our local 3027 (vc-call-backend backend 'annotate-command file
3020 ;; variables before the show-function is called at the exit of 3028 (get-buffer temp-buffer-name) rev)
3021 ;; with-output-to-temp-buffer 3029 ;; we must setup the mode first, and then set our local
3022 (with-current-buffer temp-buffer-name 3030 ;; variables before the show-function is called at the exit of
3023 (unless (equal major-mode 'vc-annotate-mode) 3031 ;; with-output-to-temp-buffer
3024 (vc-annotate-mode)) 3032 (with-current-buffer temp-buffer-name
3025 (set (make-local-variable 'vc-annotate-backend) (vc-backend file)) 3033 (unless (equal major-mode 'vc-annotate-mode)
3026 (set (make-local-variable 'vc-annotate-parent-file) file) 3034 (vc-annotate-mode))
3027 (set (make-local-variable 'vc-annotate-parent-rev) rev) 3035 (set (make-local-variable 'vc-annotate-backend) backend)
3028 (set (make-local-variable 'vc-annotate-parent-display-mode) 3036 (set (make-local-variable 'vc-annotate-parent-file) file)
3029 display-mode))) 3037 (set (make-local-variable 'vc-annotate-parent-rev) rev)
3038 (set (make-local-variable 'vc-annotate-parent-display-mode)
3039 display-mode))))
3030 3040
3031 (with-current-buffer temp-buffer-name 3041 (with-current-buffer temp-buffer-name
3032 (vc-exec-after 3042 (vc-exec-after
@@ -3103,7 +3113,8 @@ revisions after."
3103 (if (not rev-at-line) 3113 (if (not rev-at-line)
3104 (message "Cannot extract revision number from the current line") 3114 (message "Cannot extract revision number from the current line")
3105 (setq prev-rev 3115 (setq prev-rev
3106 (vc-call previous-revision vc-annotate-parent-file rev-at-line)) 3116 (vc-call-backend vc-annotate-backend 'previous-revision
3117 vc-annotate-parent-file rev-at-line))
3107 (vc-annotate-warp-revision prev-rev))))) 3118 (vc-annotate-warp-revision prev-rev)))))
3108 3119
3109(defun vc-annotate-show-log-revision-at-line () 3120(defun vc-annotate-show-log-revision-at-line ()
@@ -3126,7 +3137,8 @@ revisions after."
3126 (if (not rev-at-line) 3137 (if (not rev-at-line)
3127 (message "Cannot extract revision number from the current line") 3138 (message "Cannot extract revision number from the current line")
3128 (setq prev-rev 3139 (setq prev-rev
3129 (vc-call previous-revision vc-annotate-parent-file rev-at-line)) 3140 (vc-call-backend vc-annotate-backend 'previous-revision
3141 vc-annotate-parent-file rev-at-line))
3130 (if (not prev-rev) 3142 (if (not prev-rev)
3131 (message "Cannot diff from any revision prior to %s" rev-at-line) 3143 (message "Cannot diff from any revision prior to %s" rev-at-line)
3132 (save-window-excursion 3144 (save-window-excursion
@@ -3157,18 +3169,18 @@ revision."
3157 ((and (integerp revspec) (> revspec 0)) 3169 ((and (integerp revspec) (> revspec 0))
3158 (setq newrev vc-annotate-parent-rev) 3170 (setq newrev vc-annotate-parent-rev)
3159 (while (and (> revspec 0) newrev) 3171 (while (and (> revspec 0) newrev)
3160 (setq newrev (vc-call next-revision 3172 (setq newrev (vc-call-backend vc-annotate-backend 'next-revision
3161 vc-annotate-parent-file newrev)) 3173 vc-annotate-parent-file newrev))
3162 (setq revspec (1- revspec))) 3174 (setq revspec (1- revspec)))
3163 (unless newrev 3175 (unless newrev
3164 (message "Cannot increment %d revisions from revision %s" 3176 (message "Cannot increment %d revisions from revision %s"
3165 revspeccopy vc-annotate-parent-rev))) 3177 revspeccopy vc-annotate-parent-rev)))
3166 ((and (integerp revspec) (< revspec 0)) 3178 ((and (integerp revspec) (< revspec 0))
3167 (setq newrev vc-annotate-parent-rev) 3179 (setq newrev vc-annotate-parent-rev)
3168 (while (and (< revspec 0) newrev) 3180 (while (and (< revspec 0) newrev)
3169 (setq newrev (vc-call previous-revision 3181 (setq newrev (vc-call-backend vc-annotate-backend 'previous-revision
3170 vc-annotate-parent-file newrev)) 3182 vc-annotate-parent-file newrev))
3171 (setq revspec (1+ revspec))) 3183 (setq revspec (1+ revspec)))
3172 (unless newrev 3184 (unless newrev
3173 (message "Cannot decrement %d revisions from revision %s" 3185 (message "Cannot decrement %d revisions from revision %s"
3174 (- 0 revspeccopy) vc-annotate-parent-rev))) 3186 (- 0 revspeccopy) vc-annotate-parent-rev)))
@@ -3181,8 +3193,8 @@ revision."
3181 ;; Pass the current line so that vc-annotate will 3193 ;; Pass the current line so that vc-annotate will
3182 ;; place the point in the line. 3194 ;; place the point in the line.
3183 (min oldline (progn (goto-char (point-max)) 3195 (min oldline (progn (goto-char (point-max))
3184 (forward-line -1) 3196 (forward-line -1)
3185 (line-number-at-pos)))))))) 3197 (line-number-at-pos))))))))
3186 3198
3187(defun vc-annotate-compcar (threshold a-list) 3199(defun vc-annotate-compcar (threshold a-list)
3188 "Test successive cons cells of A-LIST against THRESHOLD. 3200 "Test successive cons cells of A-LIST against THRESHOLD.