From 45b24b4de643475dc82737a89bf9d1c250ce3d9e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 21 Mar 2008 17:53:04 +0000 Subject: * vc-hooks.el (vc-default-mode-line-string): Add case for added files. * vc.el (vc-default-dired-state-info): Use just "modified". * vc-cvs.el (vc-cvs-state-heuristic): Turn rev 0 into `added'. (vc-cvs-mode-line-string): Make use of the better default. (vc-cvs-parse-entry): Use the new `added'. (vc-cvs-dired-state-info): Remove. * vc-svn.el (vc-svn-dired-state-info): Remove. * vc-hg.el (vc-hg-dired-state-info): Remove. * vc-git.el (vc-git-dired-state-info): Remove. --- lisp/vc-cvs.el | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'lisp/vc-cvs.el') diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index cc63131945e..f75b3f4ebf5 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -207,9 +207,10 @@ See also variable `vc-cvs-sticky-date-format-string'." ;; Otherwise consider it `edited'. (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) (lastmod (nth 5 (file-attributes file)))) - (if (equal checkout-time lastmod) - 'up-to-date - 'edited))) + (cond + ((equal checkout-time lastmod) 'up-to-date) + ((string= (vc-working-revision file) "0") 'added) + (t 'edited)))) (defun vc-cvs-dir-state (dir) "Find the CVS state of all files in DIR and subdirectories." @@ -261,16 +262,11 @@ Handle the special case of a CVS file that is added but not yet committed and support display of sticky tags." (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag)) help-echo - (string - (if (string= (vc-working-revision file) "0") - ;; A file that is added but not yet committed. - (progn - (setq help-echo "Added file (needs commit) under CVS") - "CVS @@") - (let ((def-ml (vc-default-mode-line-string 'CVS file))) - (setq help-echo - (get-text-property 0 'help-echo def-ml)) - def-ml)))) + (string + (let ((def-ml (vc-default-mode-line-string 'CVS file))) + (setq help-echo + (get-text-property 0 'help-echo def-ml)) + def-ml))) (propertize (if (zerop (length sticky-tag)) string @@ -279,14 +275,6 @@ committed and support display of sticky tags." (concat string "[" sticky-tag "]")) 'help-echo help-echo))) -(defun vc-cvs-dired-state-info (file) - "CVS-specific version of `vc-dired-state-info'." - (let ((cvs-state (vc-state file))) - (cond ((eq cvs-state 'edited) - (if (equal (vc-working-revision file) "0") - "(added)" "(modified)")) - (t - (vc-default-dired-state-info 'CVS file))))) ;;; ;;; State-changing functions @@ -960,7 +948,7 @@ is non-nil." (vc-file-setprop file 'vc-backend 'CVS) (vc-file-setprop file 'vc-checkout-time 0) (vc-file-setprop file 'vc-working-revision "0") - (if set-state (vc-file-setprop file 'vc-state 'edited))) + (if set-state (vc-file-setprop file 'vc-state 'added))) ;; normal entry ((looking-at (concat "/[^/]+" -- cgit v1.2.1