From: Stefan Monnier Date: Fri, 9 May 2003 14:32:01 +0000 (+0000) Subject: (vc-cvs-mode-line-string): Use vc-default-mode-line-string. X-Git-Tag: ttn-vms-21-2-B4~10225 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a0688443cc452106c01d7fb4474949a27c178322;p=emacs.git (vc-cvs-mode-line-string): Use vc-default-mode-line-string. (vc-cvs-delete-file, vc-cvs-rename-file): New functions. --- diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 6a4feb3f4c5..798ee5c6803 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -5,7 +5,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel -;; $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 @@ See also variable `vc-cvs-sticky-date-format-string'." 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 @@ REV is the revision to check out into WORKFILE." (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