Mercurial > emacs
comparison lisp/vc-git.el @ 87516:de0bd1c6cbfd
(vc-git-dir-state): Set the vc-backend property. Do
not disable undo, with-temp-buffer does it by default.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Tue, 01 Jan 2008 19:47:21 +0000 |
parents | b5060e79eb98 |
children | 77d4b0e5e5d2 |
comparison
equal
deleted
inserted
replaced
87515:32fc9891d86e | 87516:de0bd1c6cbfd |
---|---|
153 | 153 |
154 (defun vc-git-dir-state (dir) | 154 (defun vc-git-dir-state (dir) |
155 "Git-specific version of `dir-state'." | 155 "Git-specific version of `dir-state'." |
156 ;; FIXME: This can't set 'ignored yet | 156 ;; FIXME: This can't set 'ignored yet |
157 (with-temp-buffer | 157 (with-temp-buffer |
158 (buffer-disable-undo) ;; Because these buffers can get huge | |
159 (vc-git-command (current-buffer) nil nil "ls-files" "-t" "-c" "-m" "-o") | 158 (vc-git-command (current-buffer) nil nil "ls-files" "-t" "-c" "-m" "-o") |
160 (goto-char (point-min)) | 159 (goto-char (point-min)) |
161 (let ((status-char nil) | 160 (let ((status-char nil) |
162 (file nil)) | 161 (file nil)) |
163 (while (not (eobp)) | 162 (while (not (eobp)) |
170 ;; The rest of the possible states in "git ls-files -t" output: | 169 ;; The rest of the possible states in "git ls-files -t" output: |
171 ;; K to be killed | 170 ;; K to be killed |
172 ;; should not show up in vc-dired, so don't deal with them | 171 ;; should not show up in vc-dired, so don't deal with them |
173 ;; here. | 172 ;; here. |
174 ((eq status-char ?H) | 173 ((eq status-char ?H) |
174 (vc-file-setprop file 'vc-backend 'Git) | |
175 (vc-file-setprop file 'vc-state 'up-to-date)) | 175 (vc-file-setprop file 'vc-state 'up-to-date)) |
176 ((eq status-char ?R) | 176 ((eq status-char ?R) |
177 (vc-file-setprop file 'vc-backend 'Git) | |
177 (vc-file-setprop file 'vc-state 'removed)) | 178 (vc-file-setprop file 'vc-state 'removed)) |
178 ((eq status-char ?M) | 179 ((eq status-char ?M) |
180 (vc-file-setprop file 'vc-backend 'Git) | |
179 (vc-file-setprop file 'vc-state 'edited)) | 181 (vc-file-setprop file 'vc-state 'edited)) |
180 ((eq status-char ?C) | 182 ((eq status-char ?C) |
183 (vc-file-setprop file 'vc-backend 'Git) | |
181 (vc-file-setprop file 'vc-state 'edited)) | 184 (vc-file-setprop file 'vc-state 'edited)) |
182 ((eq status-char ??) | 185 ((eq status-char ??) |
183 (vc-file-setprop file 'vc-backend 'none) | 186 (vc-file-setprop file 'vc-backend 'none) |
184 (vc-file-setprop file 'vc-state nil))) | 187 (vc-file-setprop file 'vc-state nil))) |
185 (forward-line))))) | 188 (forward-line))))) |