diff options
| author | Stefan Monnier | 2008-03-21 17:53:04 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-03-21 17:53:04 +0000 |
| commit | 45b24b4de643475dc82737a89bf9d1c250ce3d9e (patch) | |
| tree | 8613ae3aeedd29793f98a06f9a8503513a08b83e | |
| parent | e345c46e5613f29d17a1c9e6c663c80925e33129 (diff) | |
| download | emacs-45b24b4de643475dc82737a89bf9d1c250ce3d9e.tar.gz emacs-45b24b4de643475dc82737a89bf9d1c250ce3d9e.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/vc-cvs.el | 32 | ||||
| -rw-r--r-- | lisp/vc-git.el | 8 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 13 | ||||
| -rw-r--r-- | lisp/vc-hooks.el | 3 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 11 | ||||
| -rw-r--r-- | lisp/vc.el | 2 |
7 files changed, 28 insertions, 53 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c7a0c979f3..7967d04c0ea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2008-03-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * vc-hooks.el (vc-default-mode-line-string): Add case for added files. | ||
| 4 | * vc.el (vc-default-dired-state-info): Use just "modified". | ||
| 5 | * vc-cvs.el (vc-cvs-state-heuristic): Turn rev 0 into `added'. | ||
| 6 | (vc-cvs-mode-line-string): Make use of the better default. | ||
| 7 | (vc-cvs-parse-entry): Use the new `added'. | ||
| 8 | (vc-cvs-dired-state-info): Remove. | ||
| 9 | * vc-svn.el (vc-svn-dired-state-info): Remove. | ||
| 10 | * vc-hg.el (vc-hg-dired-state-info): Remove. | ||
| 11 | * vc-git.el (vc-git-dired-state-info): Remove. | ||
| 12 | |||
| 1 | 2008-03-21 Dan Nicolaescu <dann@ics.uci.edu> | 13 | 2008-03-21 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 14 | ||
| 3 | * vc-git.el (vc-git-status-result): New variable. | 15 | * vc-git.el (vc-git-status-result): New variable. |
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'." | |||
| 207 | ;; Otherwise consider it `edited'. | 207 | ;; Otherwise consider it `edited'. |
| 208 | (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) | 208 | (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) |
| 209 | (lastmod (nth 5 (file-attributes file)))) | 209 | (lastmod (nth 5 (file-attributes file)))) |
| 210 | (if (equal checkout-time lastmod) | 210 | (cond |
| 211 | 'up-to-date | 211 | ((equal checkout-time lastmod) 'up-to-date) |
| 212 | 'edited))) | 212 | ((string= (vc-working-revision file) "0") 'added) |
| 213 | (t 'edited)))) | ||
| 213 | 214 | ||
| 214 | (defun vc-cvs-dir-state (dir) | 215 | (defun vc-cvs-dir-state (dir) |
| 215 | "Find the CVS state of all files in DIR and subdirectories." | 216 | "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 | |||
| 261 | committed and support display of sticky tags." | 262 | committed and support display of sticky tags." |
| 262 | (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag)) | 263 | (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag)) |
| 263 | help-echo | 264 | help-echo |
| 264 | (string | 265 | (string |
| 265 | (if (string= (vc-working-revision file) "0") | 266 | (let ((def-ml (vc-default-mode-line-string 'CVS file))) |
| 266 | ;; A file that is added but not yet committed. | 267 | (setq help-echo |
| 267 | (progn | 268 | (get-text-property 0 'help-echo def-ml)) |
| 268 | (setq help-echo "Added file (needs commit) under CVS") | 269 | def-ml))) |
| 269 | "CVS @@") | ||
| 270 | (let ((def-ml (vc-default-mode-line-string 'CVS file))) | ||
| 271 | (setq help-echo | ||
| 272 | (get-text-property 0 'help-echo def-ml)) | ||
| 273 | def-ml)))) | ||
| 274 | (propertize | 270 | (propertize |
| 275 | (if (zerop (length sticky-tag)) | 271 | (if (zerop (length sticky-tag)) |
| 276 | string | 272 | string |
| @@ -279,14 +275,6 @@ committed and support display of sticky tags." | |||
| 279 | (concat string "[" sticky-tag "]")) | 275 | (concat string "[" sticky-tag "]")) |
| 280 | 'help-echo help-echo))) | 276 | 'help-echo help-echo))) |
| 281 | 277 | ||
| 282 | (defun vc-cvs-dired-state-info (file) | ||
| 283 | "CVS-specific version of `vc-dired-state-info'." | ||
| 284 | (let ((cvs-state (vc-state file))) | ||
| 285 | (cond ((eq cvs-state 'edited) | ||
| 286 | (if (equal (vc-working-revision file) "0") | ||
| 287 | "(added)" "(modified)")) | ||
| 288 | (t | ||
| 289 | (vc-default-dired-state-info 'CVS file))))) | ||
| 290 | 278 | ||
| 291 | ;;; | 279 | ;;; |
| 292 | ;;; State-changing functions | 280 | ;;; State-changing functions |
| @@ -960,7 +948,7 @@ is non-nil." | |||
| 960 | (vc-file-setprop file 'vc-backend 'CVS) | 948 | (vc-file-setprop file 'vc-backend 'CVS) |
| 961 | (vc-file-setprop file 'vc-checkout-time 0) | 949 | (vc-file-setprop file 'vc-checkout-time 0) |
| 962 | (vc-file-setprop file 'vc-working-revision "0") | 950 | (vc-file-setprop file 'vc-working-revision "0") |
| 963 | (if set-state (vc-file-setprop file 'vc-state 'edited))) | 951 | (if set-state (vc-file-setprop file 'vc-state 'added))) |
| 964 | ;; normal entry | 952 | ;; normal entry |
| 965 | ((looking-at | 953 | ((looking-at |
| 966 | (concat "/[^/]+" | 954 | (concat "/[^/]+" |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 888d2aaddf2..8bbb16a62a0 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -199,14 +199,6 @@ | |||
| 199 | (propertize def-ml | 199 | (propertize def-ml |
| 200 | 'help-echo (concat help-echo "\nCurrent branch: " branch))))) | 200 | 'help-echo (concat help-echo "\nCurrent branch: " branch))))) |
| 201 | 201 | ||
| 202 | (defun vc-git-dired-state-info (file) | ||
| 203 | "Git-specific version of `vc-dired-state-info'." | ||
| 204 | (let ((git-state (vc-state file))) | ||
| 205 | (if (eq git-state 'edited) | ||
| 206 | "(modified)" | ||
| 207 | ;; fall back to the default VC representation | ||
| 208 | (vc-default-dired-state-info 'Git file)))) | ||
| 209 | |||
| 210 | ;; Variable used to keep the intermediate results for vc-git-status. | 202 | ;; Variable used to keep the intermediate results for vc-git-status. |
| 211 | (defvar vc-git-status-result nil) | 203 | (defvar vc-git-status-result nil) |
| 212 | 204 | ||
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 46617fe19ac..8e55eb20174 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -449,15 +449,6 @@ REV is the revision to check out into WORKFILE." | |||
| 449 | (defun vc-hg-workfile-unchanged-p (file) | 449 | (defun vc-hg-workfile-unchanged-p (file) |
| 450 | (eq 'up-to-date (vc-hg-state file))) | 450 | (eq 'up-to-date (vc-hg-state file))) |
| 451 | 451 | ||
| 452 | (defun vc-hg-dired-state-info (file) | ||
| 453 | "Hg-specific version of `vc-dired-state-info'." | ||
| 454 | (let ((hg-state (vc-state file))) | ||
| 455 | (if (eq hg-state 'edited) | ||
| 456 | (if (equal (vc-working-revision file) "0") | ||
| 457 | "(added)" "(modified)") | ||
| 458 | ;; fall back to the default VC representation | ||
| 459 | (vc-default-dired-state-info 'Hg file)))) | ||
| 460 | |||
| 461 | ;; Modelled after the similar function in vc-bzr.el | 452 | ;; Modelled after the similar function in vc-bzr.el |
| 462 | (defun vc-hg-revert (file &optional contents-done) | 453 | (defun vc-hg-revert (file &optional contents-done) |
| 463 | (unless contents-done | 454 | (unless contents-done |
| @@ -465,8 +456,8 @@ REV is the revision to check out into WORKFILE." | |||
| 465 | 456 | ||
| 466 | ;;; Hg specific functionality. | 457 | ;;; Hg specific functionality. |
| 467 | 458 | ||
| 468 | ;;; XXX This functionality is experimental/work in progress. It might | 459 | ;; XXX This functionality is experimental/work in progress. It might |
| 469 | ;;; change without notice. | 460 | ;; change without notice. |
| 470 | (defvar vc-hg-extra-menu-map | 461 | (defvar vc-hg-extra-menu-map |
| 471 | (let ((map (make-sparse-keymap))) | 462 | (let ((map (make-sparse-keymap))) |
| 472 | (define-key map [incoming] '(menu-item "Show incoming" vc-hg-incoming)) | 463 | (define-key map [incoming] '(menu-item "Show incoming" vc-hg-incoming)) |
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index e167492c089..cf17f9becb7 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -856,6 +856,9 @@ This function assumes that the file is registered." | |||
| 856 | ((stringp state) | 856 | ((stringp state) |
| 857 | (setq state-echo (concat "File locked by" state)) | 857 | (setq state-echo (concat "File locked by" state)) |
| 858 | (concat backend ":" state ":" rev)) | 858 | (concat backend ":" state ":" rev)) |
| 859 | ((eq state 'added) | ||
| 860 | (setq state-echo "Locally added file") | ||
| 861 | (concat backend "@" rev)) | ||
| 859 | (t | 862 | (t |
| 860 | ;; Not just for the 'edited state, but also a fallback | 863 | ;; Not just for the 'edited state, but also a fallback |
| 861 | ;; for all other states. Think about different symbols | 864 | ;; for all other states. Think about different symbols |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index c10aa65f930..c50434c4630 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -205,17 +205,6 @@ RESULT is a list of conses (FILE . STATE) for directory DIR." | |||
| 205 | ;; vc-svn-mode-line-string doesn't exist because the default implementation | 205 | ;; vc-svn-mode-line-string doesn't exist because the default implementation |
| 206 | ;; works just fine. | 206 | ;; works just fine. |
| 207 | 207 | ||
| 208 | (defun vc-svn-dired-state-info (file) | ||
| 209 | "SVN-specific version of `vc-dired-state-info'." | ||
| 210 | (let ((svn-state (vc-state file))) | ||
| 211 | (cond ((eq svn-state 'edited) | ||
| 212 | (if (equal (vc-working-revision file) "0") | ||
| 213 | "(added)" "(modified)")) | ||
| 214 | (t | ||
| 215 | ;; fall back to the default VC representation | ||
| 216 | (vc-default-dired-state-info 'SVN file))))) | ||
| 217 | |||
| 218 | |||
| 219 | (defun vc-svn-previous-revision (file rev) | 208 | (defun vc-svn-previous-revision (file rev) |
| 220 | (let ((newrev (1- (string-to-number rev)))) | 209 | (let ((newrev (1- (string-to-number rev)))) |
| 221 | (when (< 0 newrev) | 210 | (when (< 0 newrev) |
diff --git a/lisp/vc.el b/lisp/vc.el index be7516e6237..81d45870e64 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -3736,7 +3736,7 @@ to provide the `find-revision' operation instead." | |||
| 3736 | (statestring | 3736 | (statestring |
| 3737 | (cond | 3737 | (cond |
| 3738 | ((stringp state) (concat "(" state ")")) | 3738 | ((stringp state) (concat "(" state ")")) |
| 3739 | ((eq state 'edited) (concat "(" (vc-user-login-name file) ")")) | 3739 | ((eq state 'edited) "(modified)") |
| 3740 | ((eq state 'needs-merge) "(merge)") | 3740 | ((eq state 'needs-merge) "(merge)") |
| 3741 | ((eq state 'needs-patch) "(patch)") | 3741 | ((eq state 'needs-patch) "(patch)") |
| 3742 | ((eq state 'added) "(added)") | 3742 | ((eq state 'added) "(added)") |