Mercurial > emacs
diff lisp/vc-rcs.el @ 94563:a0bb8ca25a33
Clean up vc*-revision-granularity and vc*-checkout-model.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Fri, 02 May 2008 17:47:25 +0000 |
parents | e158200330c2 |
children | 9cc7bc51e055 |
line wrap: on
line diff
--- a/lisp/vc-rcs.el Fri May 02 17:39:02 2008 +0000 +++ b/lisp/vc-rcs.el Fri May 02 17:47:25 2008 +0000 @@ -102,8 +102,19 @@ ;;; Properties of the backend -(defun vc-rcs-revision-granularity () - 'file) +(defun vc-rcs-revision-granularity () 'file) + +(defun vc-rcs-checkout-model (files) + "RCS-specific version of `vc-checkout-model'." + (let ((file (if (consp files) (car files) files)) + result) + (when vc-consult-headers + (vc-file-setprop file 'vc-checkout-model nil) + (vc-rcs-consult-headers file) + (setq result (vc-file-getprop file 'vc-checkout-model))) + (or result + (progn (vc-rcs-fetch-master-state file) + (vc-file-getprop file 'vc-checkout-model))))) ;;; ;;; State-querying functions @@ -134,7 +145,7 @@ state (if (vc-workfile-unchanged-p file) 'up-to-date - (if (eq (vc-rcs-checkout-model file) 'locking) + (if (eq (vc-rcs-checkout-model (list file)) 'locking) 'unlocked-changes 'edited)))))) @@ -218,18 +229,6 @@ (vc-insert-file (vc-name file) "^desc") (vc-rcs-find-most-recent-rev (vc-branch-part version)))))) -(defun vc-rcs-checkout-model (files) - "RCS-specific version of `vc-checkout-model'." - (let ((file (if (consp files) (car files) files)) - result) - (when vc-consult-headers - (vc-file-setprop file 'vc-checkout-model nil) - (vc-rcs-consult-headers file) - (setq result (vc-file-getprop file 'vc-checkout-model))) - (or result - (progn (vc-rcs-fetch-master-state file) - (vc-file-getprop file 'vc-checkout-model))))) - (defun vc-rcs-workfile-unchanged-p (file) "RCS-specific implementation of `vc-workfile-unchanged-p'." ;; Try to use rcsdiff --brief. If rcsdiff does not understand that, @@ -320,7 +319,7 @@ (defun vc-rcs-receive-file (file rev) "Implementation of receive-file for RCS." - (let ((checkout-model (vc-rcs-checkout-model file))) + (let ((checkout-model (vc-rcs-checkout-model (list file)))) (vc-rcs-register file rev "") (when (eq checkout-model 'implicit) (vc-rcs-set-non-strict-locking file)) @@ -431,7 +430,7 @@ nil 0 "co" (vc-name file) ;; If locking is not strict, force to overwrite ;; the writable workfile. - (if (eq (vc-rcs-checkout-model file) 'implicit) "-f") + (if (eq (vc-rcs-checkout-model (list file)) 'implicit) "-f") (if editable "-l") (if (stringp rev) ;; a literal revision was specified @@ -894,7 +893,7 @@ ;; locked by the calling user ((and (stringp locking-user) (string= locking-user (vc-user-login-name file))) - (if (or (eq (vc-rcs-checkout-model file) 'locking) + (if (or (eq (vc-rcs-checkout-model (list file)) 'locking) workfile-is-latest (vc-rcs-latest-on-branch-p file working-revision)) 'edited