diff options
| author | Eric S. Raymond | 2007-12-28 18:16:55 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 2007-12-28 18:16:55 +0000 |
| commit | 722f037fc8a4d7e22d700de4504b7db7a9927450 (patch) | |
| tree | 6888a2a7ec7b7363cd39d43fdfe9eaf0274a19b0 | |
| parent | 0f67cc71b4047fd71b873a4e73644a097722869c (diff) | |
| download | emacs-722f037fc8a4d7e22d700de4504b7db7a9927450.tar.gz emacs-722f037fc8a4d7e22d700de4504b7db7a9927450.zip | |
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
states. and the new return-value convention. These are not
actually used yet, just set.
* vc-svn.el (vc-svn-parse-status): Set 'ignored and 'unregistered
states when appropriate.
* vc-hg.el (vc-hg-state,vc-hg-dir-state): Set 'ignored and
'unregistered' when appropriate.
* vc-git.el: Document that we don't set the new states yet.
* vc.el (vc-dired-state-info): Display 'unregistered and
'ignored states.
* vc-cvs.el (vc-cvs-parse-status): Set the 'ignored state when
appropriate.
* vc-bzr.el (vc-bzr-dir-state): Set 'ignored and
'unregistered' when appropriate.
| -rw-r--r-- | lisp/ChangeLog | 25 | ||||
| -rw-r--r-- | lisp/vc-bzr.el | 7 | ||||
| -rw-r--r-- | lisp/vc-cvs.el | 7 | ||||
| -rw-r--r-- | lisp/vc-git.el | 3 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 10 | ||||
| -rw-r--r-- | lisp/vc-hooks.el | 22 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 4 | ||||
| -rw-r--r-- | lisp/vc.el | 5 |
8 files changed, 73 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eefada19f60..b68e3dedd35 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -17,7 +17,30 @@ | |||
| 17 | can get extremely large. | 17 | can get extremely large. |
| 18 | 18 | ||
| 19 | * vc-cvs.el, vc-svn.el: Simplify backend dired-state-info | 19 | * vc-cvs.el, vc-svn.el: Simplify backend dired-state-info |
| 20 | functions so they don't do work that the default one can do instead | 20 | functions so they don't do work that the default one can do |
| 21 | instead. Also, give the default useful behavior on 'added. | ||
| 22 | |||
| 23 | * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered | ||
| 24 | states. and the new return-value convention. These are not | ||
| 25 | actually used yet, just set. | ||
| 26 | |||
| 27 | * vc-svn.el (vc-svn-parse-status): Set 'ignored and 'unregistered | ||
| 28 | states when appropriate. | ||
| 29 | |||
| 30 | * vc-hg.el (vc-hg-state,vc-hg-dir-state): Set 'ignored and | ||
| 31 | 'unregistered' when appropriate. | ||
| 32 | |||
| 33 | * vc-git.el: Document that we don't set the new states yet. | ||
| 34 | |||
| 35 | * vc.el (vc-dired-state-info): Display 'unregistered and | ||
| 36 | 'ignored states. | ||
| 37 | |||
| 38 | * vc-cvs.el (vc-cvs-parse-status): Set the 'ignored state when | ||
| 39 | appropriate. | ||
| 40 | |||
| 41 | * vc-bzr.el (vc-bzr-dir-state): Set 'ignored and | ||
| 42 | 'unregistered' when appropriate. | ||
| 43 | |||
| 21 | 44 | ||
| 22 | 2007-12-28 Nick Roberts <nickrob@snap.net.nz> | 45 | 2007-12-28 Nick Roberts <nickrob@snap.net.nz> |
| 23 | 46 | ||
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index c87424fb8f6..01599c91dff 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -533,8 +533,11 @@ Optional argument LOCALP is always ignored." | |||
| 533 | ((looking-at "^renamed") | 533 | ((looking-at "^renamed") |
| 534 | (setq current-vc-state 'edited) | 534 | (setq current-vc-state 'edited) |
| 535 | (setq current-bzr-state 'renamed)) | 535 | (setq current-bzr-state 'renamed)) |
| 536 | ((looking-at "^\\(unknown\\|ignored\\)") | 536 | ((looking-at "^ignored") |
| 537 | (setq current-vc-state nil) | 537 | (setq current-vc-state 'ignored) |
| 538 | (setq current-bzr-state 'not-versioned)) | ||
| 539 | ((looking-at "^unknown") | ||
| 540 | (setq current-vc-state 'unregistered) | ||
| 538 | (setq current-bzr-state 'not-versioned)) | 541 | (setq current-bzr-state 'not-versioned)) |
| 539 | ((looking-at " ") | 542 | ((looking-at " ") |
| 540 | ;; file names are indented by two spaces | 543 | ;; file names are indented by two spaces |
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 3728d725478..c3aff66588b 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el | |||
| @@ -818,9 +818,14 @@ For an empty string, nil is returned (invalid CVS root)." | |||
| 818 | (defun vc-cvs-parse-status (&optional full) | 818 | (defun vc-cvs-parse-status (&optional full) |
| 819 | "Parse output of \"cvs status\" command in the current buffer. | 819 | "Parse output of \"cvs status\" command in the current buffer. |
| 820 | Set file properties accordingly. Unless FULL is t, parse only | 820 | Set file properties accordingly. Unless FULL is t, parse only |
| 821 | essential information." | 821 | essential information. Note that this can never set the 'ignored |
| 822 | state." | ||
| 822 | (let (file status) | 823 | (let (file status) |
| 823 | (goto-char (point-min)) | 824 | (goto-char (point-min)) |
| 825 | (while (looking-at "? \\(.*\\)") | ||
| 826 | (setq file (expand-file-name (match-string 1))) | ||
| 827 | (vc-file-setprop file 'vc-state 'unregistered) | ||
| 828 | (forward-line 1)) | ||
| 824 | (if (re-search-forward "^File: " nil t) | 829 | (if (re-search-forward "^File: " nil t) |
| 825 | (cond | 830 | (cond |
| 826 | ((looking-at "no file") nil) | 831 | ((looking-at "no file") nil) |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 722e352f4f0..7895251be0e 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -143,6 +143,7 @@ | |||
| 143 | 143 | ||
| 144 | (defun vc-git-state (file) | 144 | (defun vc-git-state (file) |
| 145 | "Git-specific version of `vc-state'." | 145 | "Git-specific version of `vc-state'." |
| 146 | ;; FIXME: This can't set 'ignored yet | ||
| 146 | (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) | 147 | (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) |
| 147 | (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) | 148 | (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) |
| 148 | (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} [ADMU]\0[^\0]+\0" | 149 | (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} [ADMU]\0[^\0]+\0" |
| @@ -151,6 +152,8 @@ | |||
| 151 | 'up-to-date))) | 152 | 'up-to-date))) |
| 152 | 153 | ||
| 153 | (defun vc-git-dir-state (dir) | 154 | (defun vc-git-dir-state (dir) |
| 155 | "Git-specific version of `dir-state'." | ||
| 156 | ;; FIXME: This can't set 'ignored yet | ||
| 154 | (with-temp-buffer | 157 | (with-temp-buffer |
| 155 | (buffer-disable-undo) ;; Because these buffers can get huge | 158 | (buffer-disable-undo) ;; Because these buffers can get huge |
| 156 | (vc-git-command (current-buffer) nil nil "ls-files" "-t" "-c" "-m" "-o") | 159 | (vc-git-command (current-buffer) nil nil "ls-files" "-t" "-c" "-m" "-o") |
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 5c2cc35229d..592bccaf517 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -173,8 +173,9 @@ | |||
| 173 | (cond | 173 | (cond |
| 174 | ((eq state ?A) 'edited) | 174 | ((eq state ?A) 'edited) |
| 175 | ((eq state ?M) 'edited) | 175 | ((eq state ?M) 'edited) |
| 176 | ((eq state ?R) nil) | 176 | ((eq state ?I) 'ignored) |
| 177 | ((eq state ??) nil) | 177 | ((eq state ?R) 'unregistered) |
| 178 | ((eq state ??) 'unregistered) | ||
| 178 | (t 'up-to-date)))))))) | 179 | (t 'up-to-date)))))))) |
| 179 | 180 | ||
| 180 | (defun vc-hg-dir-state (dir) | 181 | (defun vc-hg-dir-state (dir) |
| @@ -194,7 +195,6 @@ | |||
| 194 | ;; The rest of the possible states in "hg status" output: | 195 | ;; The rest of the possible states in "hg status" output: |
| 195 | ;; R = removed | 196 | ;; R = removed |
| 196 | ;; ! = deleted, but still tracked | 197 | ;; ! = deleted, but still tracked |
| 197 | ;; ? = not tracked | ||
| 198 | ;; should not show up in vc-dired, so don't deal with them | 198 | ;; should not show up in vc-dired, so don't deal with them |
| 199 | ;; here. | 199 | ;; here. |
| 200 | ((eq status-char ?A) | 200 | ((eq status-char ?A) |
| @@ -202,9 +202,11 @@ | |||
| 202 | (vc-file-setprop file 'vc-state 'edited)) | 202 | (vc-file-setprop file 'vc-state 'edited)) |
| 203 | ((eq status-char ?M) | 203 | ((eq status-char ?M) |
| 204 | (vc-file-setprop file 'vc-state 'edited)) | 204 | (vc-file-setprop file 'vc-state 'edited)) |
| 205 | ((eq status-char ?I) | ||
| 206 | (vc-file-setprop file 'vc-state 'ignored)) | ||
| 205 | ((eq status-char ??) | 207 | ((eq status-char ??) |
| 206 | (vc-file-setprop file 'vc-backend 'none) | 208 | (vc-file-setprop file 'vc-backend 'none) |
| 207 | (vc-file-setprop file 'vc-state 'nil))) | 209 | (vc-file-setprop file 'vc-state 'unregistered))) |
| 208 | (forward-line))))) | 210 | (forward-line))))) |
| 209 | 211 | ||
| 210 | (defun vc-hg-working-revision (file) | 212 | (defun vc-hg-working-revision (file) |
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 3657878232e..3d589e117c8 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -501,7 +501,27 @@ For registered files, the value returned is one of: | |||
| 501 | 501 | ||
| 502 | 'added Scheduled to go into the repository on the next commit. | 502 | 'added Scheduled to go into the repository on the next commit. |
| 503 | Often represented by vc-working-revision = \"0\" in VCSes | 503 | Often represented by vc-working-revision = \"0\" in VCSes |
| 504 | with monotonic IDs like Subversion and Mercxurial." | 504 | with monotonic IDs like Subversion and Mercurial. |
| 505 | |||
| 506 | 'ignored The file showed up in a dir-state listing with a flag | ||
| 507 | indicating the version-control system is ignoring it, | ||
| 508 | Note: This property is not set reliably (some VCSes | ||
| 509 | don't have useful directory-status commands) so assume | ||
| 510 | that any file with vc-state nil might be ignorable | ||
| 511 | without VC knowing it. | ||
| 512 | |||
| 513 | 'unregistered The file showed up in a dir-state listing with a flag | ||
| 514 | indicating that it is not under version control. | ||
| 515 | Note: This property is not set reliably (some VCSes | ||
| 516 | don't have useful directory-status commands) so assume | ||
| 517 | that any file with vc-state nil might be unregistered | ||
| 518 | without VC knowing it. | ||
| 519 | |||
| 520 | A return of nil from this function means we have no information on the | ||
| 521 | status of this file. | ||
| 522 | " | ||
| 523 | ;; Note: in Emacs 22 and older, return of nil meant the file was unregistered. | ||
| 524 | ;; This is potentially a source of backward-compatibility bugs. | ||
| 505 | 525 | ||
| 506 | ;; FIXME: New (sub)states needed (?): | 526 | ;; FIXME: New (sub)states needed (?): |
| 507 | ;; - `conflict' (i.e. `edited' with conflict markers) | 527 | ;; - `conflict' (i.e. `edited' with conflict markers) |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 7ce1634d45c..ced4c941b55 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -578,6 +578,10 @@ information about FILENAME and return its status." | |||
| 578 | (if (eq (char-after (match-beginning 1)) ?*) | 578 | (if (eq (char-after (match-beginning 1)) ?*) |
| 579 | 'needs-merge | 579 | 'needs-merge |
| 580 | 'edited)) | 580 | 'edited)) |
| 581 | ((eq status ?I) | ||
| 582 | (vc-file-setprop file 'vc-state 'ignored)) | ||
| 583 | ((eq status ??) | ||
| 584 | (vc-file-setprop file 'vc-state 'unregistered)) | ||
| 581 | (t 'edited))))) | 585 | (t 'edited))))) |
| 582 | (if filename (vc-file-getprop filename 'vc-state)))) | 586 | (if filename (vc-file-getprop filename 'vc-state)))) |
| 583 | 587 | ||
diff --git a/lisp/vc.el b/lisp/vc.el index 373d0f50124..5ec872523b5 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -3076,7 +3076,10 @@ to provide the `find-revision' operation instead." | |||
| 3076 | ((eq state 'needs-merge) "(merge)") | 3076 | ((eq state 'needs-merge) "(merge)") |
| 3077 | ((eq state 'needs-patch) "(patch)") | 3077 | ((eq state 'needs-patch) "(patch)") |
| 3078 | ((eq state 'added) "(added)") | 3078 | ((eq state 'added) "(added)") |
| 3079 | ((eq state 'unlocked-changes) "(stale)"))) | 3079 | ((eq state 'ignored) "(ignored)") ;; dired-hook filters this out |
| 3080 | ((eq state 'unregistered) "?") | ||
| 3081 | ((eq state 'unlocked-changes) "(stale)") | ||
| 3082 | ((not state) "(unknown)"))) | ||
| 3080 | (buffer | 3083 | (buffer |
| 3081 | (get-file-buffer file)) | 3084 | (get-file-buffer file)) |
| 3082 | (modflag | 3085 | (modflag |