changeset 50923:3eab629b1239

(vc-cvs-mode-line-string): Use vc-default-mode-line-string. (vc-cvs-delete-file, vc-cvs-rename-file): New functions.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 09 May 2003 14:32:01 +0000
parents bdc62a6694f7
children 15bfd674106a
files lisp/vc-cvs.el
diffstat 1 files changed, 21 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-cvs.el	Fri May 09 14:13:40 2003 +0000
+++ b/lisp/vc-cvs.el	Fri May 09 14:32:01 2003 +0000
@@ -5,7 +5,7 @@
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-cvs.el,v 1.58 2003/05/08 20:08:12 monnier Exp $
+;; $Id: vc-cvs.el,v 1.59 2003/05/08 20:44:50 monnier Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -257,25 +257,14 @@
 Compared to the default implementation, this function does two things:
 Handle the special case of a CVS file that is added but not yet
 committed and support display of sticky tags."
-  (let* ((state   (vc-state file))
-	 (rev     (vc-workfile-version file))
-	 (sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
- 	 (sticky-tag-printable (and sticky-tag
-				    (not (string= sticky-tag ""))
- 				    (concat "[" sticky-tag "]"))))
-    (cond ((string= rev "0")
-	   ;; A file that is added but not yet committed.
-	   "CVS @@")
-	  ((or (eq state 'up-to-date)
-	       (eq state 'needs-patch))
-	   (concat "CVS-" rev sticky-tag-printable))
-          ((stringp state)
-	   (concat "CVS:" state ":" rev sticky-tag-printable))
-          (t
-           ;; Not just for the 'edited state, but also a fallback
-           ;; for all other states.  Think about different symbols
-           ;; for 'needs-patch and 'needs-merge.
-           (concat "CVS:" rev sticky-tag-printable)))))
+  (let ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
+	(string (if (string= (vc-workfile-version file) "0")
+		    ;; A file that is added but not yet committed.
+		    "CVS @@"
+		  (vc-default-mode-line-string 'CVS file))))
+    (if (zerop (length sticky-tag))
+	string
+      (concat string "[" sticky-tag "]"))))
 
 (defun vc-cvs-dired-state-info (file)
   "CVS-specific version of `vc-dired-state-info'."
@@ -448,6 +437,18 @@
 	(vc-mode-line file)
 	(message "Checking out %s...done" filename)))))
 
+(defun vc-cvs-delete-file (file)
+  (vc-cvs-command nil 0 file "remove" "-f"))
+
+(defun vc-cvs-rename-file (old new)
+  ;; CVS doesn't know how to move files, so we just remove&add.
+  (condition-case nil
+      (add-name-to-file old new)
+    (error (rename-file old new)))
+  (vc-cvs-delete-file old)
+  (with-current-buffer (find-file-noselect new)
+    (vc-register)))
+
 (defun vc-cvs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (unless contents-done