diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-09 16:41:26 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-09 16:41:26 +0000 |
commit | a749e19d070f015f11d6e4b7fad2841d4b0df358 (patch) | |
tree | 12a09c163dcd14b6892f1f191f8972487bdf6c50 /lisp/vc-hooks.el | |
parent | e7290559824406d111d306069b36dde8ced847f9 (diff) | |
download | emacs-a749e19d070f015f11d6e4b7fad2841d4b0df358.tar.gz |
* 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.
Diffstat (limited to 'lisp/vc-hooks.el')
-rw-r--r-- | lisp/vc-hooks.el | 27 |
1 files changed, 15 insertions, 12 deletions
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." ;; - `removed' ;; - `copied' and `moved' (might be handled by `removed' and `added') (or (vc-file-getprop file 'vc-state) - (when (and (> (length file) 0) (vc-backend file)) - (vc-file-setprop file 'vc-state - (vc-call state-heuristic file))))) + (when (> (length file) 0) + (let ((backend (vc-backend file))) + (when backend + (vc-file-setprop + file 'vc-state + (vc-call-backend backend 'state-heuristic file))))))) (defun vc-recompute-state (file) "Recompute the version control state of FILE, and return it. @@ -577,26 +580,26 @@ Return non-nil if FILE is unchanged." (zerop (condition-case err ;; If the implementation supports it, let the output ;; go to *vc*, not *vc-diff*, since this is an internal call. - (vc-call diff (list file) nil nil "*vc*") + (vc-call-backend backend 'diff (list file) nil nil "*vc*") (wrong-number-of-arguments ;; If this error came from the above call to vc-BACKEND-diff, ;; try again without the optional buffer argument (for ;; backward compatibility). Otherwise, resignal. (if (or (not (eq (cadr err) (indirect-function - (vc-find-backend-function (vc-backend file) - 'diff)))) + (vc-find-backend-function backend 'diff)))) (not (eq (caddr err) 4))) (signal (car err) (cdr err)) - (vc-call diff (list file))))))) + (vc-call-backend backend 'diff (list file))))))) (defun vc-working-revision (file) "Return the repository version from which FILE was checked out. If FILE is not registered, this function always returns nil." (or (vc-file-getprop file 'vc-working-revision) - (when (vc-backend file) - (vc-file-setprop file 'vc-working-revision - (vc-call working-revision file))))) + (let ((backend (vc-backend file))) + (when backend + (vc-file-setprop file 'vc-working-revision + (vc-call-backend backend 'working-revision file)))))) ;; Backward compatibility. (define-obsolete-function-alias @@ -746,7 +749,7 @@ Before doing that, check if there are any old backups and get rid of them." (and (setq backend (vc-backend file)) (vc-up-to-date-p file) (eq (vc-checkout-model backend (list file)) 'implicit) - (vc-call make-version-backups-p file) + (vc-call-backend backend 'make-version-backups-p file) (vc-make-version-backup file))))) (declare-function vc-directory-resynch-file "vc" (file)) @@ -798,7 +801,7 @@ visiting FILE." (let ((backend (vc-backend file))) (if (not backend) (setq vc-mode nil) - (let* ((ml-string (vc-call mode-line-string file)) + (let* ((ml-string (vc-call-backend backend 'mode-line-string file)) (ml-echo (get-text-property 0 'help-echo ml-string))) (setq vc-mode (concat |