* 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.
+2008-03-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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.
+
2008-03-21 Dan Nicolaescu <dann@ics.uci.edu>
* vc-git.el (vc-git-status-result): New variable.
;; 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."
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
(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
(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 "/[^/]+"
(propertize def-ml
'help-echo (concat help-echo "\nCurrent branch: " branch)))))
-(defun vc-git-dired-state-info (file)
- "Git-specific version of `vc-dired-state-info'."
- (let ((git-state (vc-state file)))
- (if (eq git-state 'edited)
- "(modified)"
- ;; fall back to the default VC representation
- (vc-default-dired-state-info 'Git file))))
-
;; Variable used to keep the intermediate results for vc-git-status.
(defvar vc-git-status-result nil)
(defun vc-hg-workfile-unchanged-p (file)
(eq 'up-to-date (vc-hg-state file)))
-(defun vc-hg-dired-state-info (file)
- "Hg-specific version of `vc-dired-state-info'."
- (let ((hg-state (vc-state file)))
- (if (eq hg-state 'edited)
- (if (equal (vc-working-revision file) "0")
- "(added)" "(modified)")
- ;; fall back to the default VC representation
- (vc-default-dired-state-info 'Hg file))))
-
;; Modelled after the similar function in vc-bzr.el
(defun vc-hg-revert (file &optional contents-done)
(unless contents-done
;;; Hg specific functionality.
-;;; XXX This functionality is experimental/work in progress. It might
-;;; change without notice.
+;; XXX This functionality is experimental/work in progress. It might
+;; change without notice.
(defvar vc-hg-extra-menu-map
(let ((map (make-sparse-keymap)))
(define-key map [incoming] '(menu-item "Show incoming" vc-hg-incoming))
((stringp state)
(setq state-echo (concat "File locked by" state))
(concat backend ":" state ":" rev))
+ ((eq state 'added)
+ (setq state-echo "Locally added file")
+ (concat backend "@" rev))
(t
;; Not just for the 'edited state, but also a fallback
;; for all other states. Think about different symbols
;; vc-svn-mode-line-string doesn't exist because the default implementation
;; works just fine.
-(defun vc-svn-dired-state-info (file)
- "SVN-specific version of `vc-dired-state-info'."
- (let ((svn-state (vc-state file)))
- (cond ((eq svn-state 'edited)
- (if (equal (vc-working-revision file) "0")
- "(added)" "(modified)"))
- (t
- ;; fall back to the default VC representation
- (vc-default-dired-state-info 'SVN file)))))
-
-
(defun vc-svn-previous-revision (file rev)
(let ((newrev (1- (string-to-number rev))))
(when (< 0 newrev)
(statestring
(cond
((stringp state) (concat "(" state ")"))
- ((eq state 'edited) (concat "(" (vc-user-login-name file) ")"))
+ ((eq state 'edited) "(modified)")
((eq state 'needs-merge) "(merge)")
((eq state 'needs-patch) "(patch)")
((eq state 'added) "(added)")