summaryrefslogtreecommitdiff
path: root/lisp/vc-hooks.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-05-09 16:41:26 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-05-09 16:41:26 +0000
commite1d5e20ac7b692f0cfe1d4bc3d2405875922831c (patch)
treefcef9729e93282b844a653ffec05d04f8f27efe9 /lisp/vc-hooks.el
parenteeb548fb22991d1bcff5459b9551eddb9b93abaa (diff)
downloademacs-e1d5e20ac7b692f0cfe1d4bc3d2405875922831c.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.el27
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