summaryrefslogtreecommitdiff
path: root/lisp/vc-rcs.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-06-23 06:35:40 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-06-23 06:35:40 +0000
commit77bf3f54522f792ec1573ab2595652252ea8cecd (patch)
treee840317e5ccee1aca58c39c7024a8be7a8279399 /lisp/vc-rcs.el
parent2764748c42990b0b80d7c641e821ed03d6dabfc7 (diff)
downloademacs-77bf3f54522f792ec1573ab2595652252ea8cecd.tar.gz
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of calling vc-backend. (vc-mode-line): Add an optional argument for the backend. Pass the backend to vc-state and vc-working-revision. Move code for special handling for vc-state being a buffer to ... * vc-rcs.el (vc-rcs-find-file-hook): * vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions. * vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout) (vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state, vc-stay-local-p and vc-mode-line calls. * vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log) (vc-cvs-diff, vc-cvs-annotate-command) (vc-cvs-make-version-backups-p, vc-cvs-stay-local-p) (vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and vc-mode-line calls. * vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of direct comparison. (vc-next-action, vc-transfer-file, vc-rename-file): Also pass the backend when calling vc-mode-line. (vc-register): Do not create a closure for calling the vc register function, call it directly.
Diffstat (limited to 'lisp/vc-rcs.el')
-rw-r--r--lisp/vc-rcs.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el
index 5b35ad0e1cc..0a5ebe42eec 100644
--- a/lisp/vc-rcs.el
+++ b/lisp/vc-rcs.el
@@ -828,6 +828,13 @@ systime, or nil if there is none. Also, reposition point."
;; Just move the master file (using vc-rcs-master-templates).
(vc-rename-master (vc-name old) new vc-rcs-master-templates))
+(defun vc-rcs-find-file-hook ()
+ ;; If the file is locked by some other user, make
+ ;; the buffer read-only. Like this, even root
+ ;; cannot modify a file that someone else has locked.
+ (stringp (vc-state buffer-file-name 'RCS))
+ (setq buffer-read-only t))
+
;;;
;;; Internal functions