Mercurial > emacs
comparison lisp/vc-git.el @ 87450:71fc7b1db920
* 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.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Fri, 28 Dec 2007 18:16:55 +0000 |
parents | c5df210848ca |
children | b5060e79eb98 |
comparison
equal
deleted
inserted
replaced
87449:7477a697d7e1 | 87450:71fc7b1db920 |
---|---|
141 (string= (substring str 0 (1+ (length name))) | 141 (string= (substring str 0 (1+ (length name))) |
142 (concat name "\0"))))))))) | 142 (concat name "\0"))))))))) |
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" |
149 diff)) | 150 diff)) |
150 'edited | 151 'edited |
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") |
157 (goto-char (point-min)) | 160 (goto-char (point-min)) |
158 (let ((status-char nil) | 161 (let ((status-char nil) |