mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* 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.
This commit is contained in:
parent
e345c46e56
commit
45b24b4de6
7 changed files with 28 additions and 53 deletions
|
|
@ -1,3 +1,15 @@
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -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 "/[^/]+"
|
||||
|
|
|
|||
|
|
@ -199,14 +199,6 @@
|
|||
(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)
|
||||
|
||||
|
|
|
|||
|
|
@ -449,15 +449,6 @@ REV is the revision to check out into WORKFILE."
|
|||
(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
|
||||
|
|
@ -465,8 +456,8 @@ REV is the revision to check out into WORKFILE."
|
|||
|
||||
;;; 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))
|
||||
|
|
|
|||
|
|
@ -856,6 +856,9 @@ This function assumes that the file is registered."
|
|||
((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
|
||||
|
|
|
|||
|
|
@ -205,17 +205,6 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
|
|||
;; 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)
|
||||
|
|
|
|||
|
|
@ -3736,7 +3736,7 @@ to provide the `find-revision' operation instead."
|
|||
(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)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue