]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
authorAndré Spiegel <spiegel@gnu.org>
Tue, 28 Aug 2001 17:06:36 +0000 (17:06 +0000)
committerAndré Spiegel <spiegel@gnu.org>
Tue, 28 Aug 2001 17:06:36 +0000 (17:06 +0000)
lisp/vc-cvs.el
lisp/vc-rcs.el
lisp/vc-sccs.el

index 9c3a6341cfb68106d234d553865dbf55f4525bf6..4a6ae5275b1cd3e65ec6d115363ff1aa63c9aaa9 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-cvs.el,v 1.22 2001/04/17 05:59:57 eliz Exp $
+;; $Id: vc-cvs.el,v 1.23 2001/07/04 15:51:18 monnier Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -378,16 +378,17 @@ REV is the revision to check out into WORKFILE."
        (vc-mode-line file)
        (message "Checking out %s...done" filename)))))
 
-(defun vc-cvs-revert (file)
+(defun vc-cvs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
-  ;; Check out via standard output (caused by the final argument
-  ;; FILE below), so that no sticky tag is set.
-  (vc-cvs-checkout file nil (vc-workfile-version file) file)
-  ;; If "cvs edit" was used to make the file writable,
-  ;; call "cvs unedit" now to undo that.
-  (if (and (not (eq (vc-cvs-checkout-model file) 'implicit))
-           vc-cvs-use-edit)
-      (vc-do-command nil 0 "cvs" file "unedit")))
+  (unless contents-done
+    ;; Check out via standard output (caused by the final argument
+    ;; FILE below), so that no sticky tag is set.
+    (vc-cvs-checkout file nil (vc-workfile-version file) file))
+  (unless (eq (vc-checkout-model file) 'implicit)
+    (if vc-cvs-use-edit
+        (vc-do-command nil 0 "cvs" file "unedit")
+      ;; Make the file read-only by switching off all w-bits
+      (set-file-modes file (logand (file-modes file) 3950)))))
 
 (defun vc-cvs-merge (file first-version &optional second-version)
   "Merge changes into current working copy of FILE.
index e33a9c6fdd49a7f84d46ea822f6b3d9e80b82123..f703b680482cd317eb89d3f454ff10d39892ce1f 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-rcs.el,v 1.19 2001/03/10 10:50:16 spiegel Exp $
+;; $Id: vc-rcs.el,v 1.20 2001/07/16 12:22:59 pj Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -455,7 +455,7 @@ whether to remove it."
                      new-version))))))
        (message "Checking out %s...done" filename)))))
 
-(defun vc-rcs-revert (file)
+(defun vc-rcs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (vc-do-command nil 0 "co" (vc-name file) "-f"
                 (concat "-u" (vc-workfile-version file))))
index 49692cd07275dad6642f1b448cd5c4c5ad4598c2..f3b922d143e6942425d08237a2c2235532a19a86 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-sccs.el,v 1.11 2001/03/29 11:49:22 spiegel Exp $
+;; $Id: vc-sccs.el,v 1.12 2001/07/16 12:22:59 pj Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -261,7 +261,7 @@ locked.  REV is the revision to check out into WORKFILE."
                   switches)))))
     (message "Checking out %s...done" filename)))
 
-(defun vc-sccs-revert (file)
+(defun vc-sccs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (vc-do-command nil 0 "unget" (vc-name file))
   (vc-do-command nil 0 "get" (vc-name file))