changeset 49021:f5b3c92f968b

(vc-rcs-revert): Unlock only if the user does have the lock.
author André Spiegel <spiegel@gnu.org>
date Fri, 03 Jan 2003 15:27:35 +0000
parents 860515917741
children bf7a6f364960
files lisp/vc-rcs.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-rcs.el	Fri Jan 03 13:00:08 2003 +0000
+++ b/lisp/vc-rcs.el	Fri Jan 03 15:27:35 2003 +0000
@@ -5,7 +5,7 @@
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-rcs.el,v 1.32 2002/12/26 14:06:33 spiegel Exp $
+;; $Id: vc-rcs.el,v 1.33 2002/12/26 14:38:20 spiegel Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -439,7 +439,8 @@
 (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))))
+                 (concat (if (eq (vc-state file) 'edited) "-u" "-r") 
+                         (vc-workfile-version file))))
 
 (defun vc-rcs-cancel-version (file editable)
   "Undo the most recent checkin of FILE.