diff options
| author | Dan Nicolaescu | 2007-12-28 22:50:18 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-12-28 22:50:18 +0000 |
| commit | 6c47d8195e2402731c5cec511019b16d6a7a02bd (patch) | |
| tree | daf95a8e084df5cca7d85cf6307750dd1656dc5f /lisp | |
| parent | 870356897e927f380841268667a92b40fb9e6782 (diff) | |
| download | emacs-6c47d8195e2402731c5cec511019b16d6a7a02bd.tar.gz emacs-6c47d8195e2402731c5cec511019b16d6a7a02bd.zip | |
(vc-hg-registered): Return the false when vc-hg-state
returns 'ignored or 'unregistered.
(vc-hg-state): Pass "-A" to the status command and deal with the
output.
(vc-hg-dir-state): Pass "-A" to the status command.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 37fe9fa861e..5b25d7336e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2007-12-28 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc-hg.el (vc-hg-registered): Return the false when vc-hg-state | ||
| 4 | returns 'ignored or 'unregistered. | ||
| 5 | (vc-hg-state): Pass "-A" to the status command and deal with the | ||
| 6 | output. | ||
| 7 | (vc-hg-dir-state): Pass "-A" to the status command. | ||
| 8 | |||
| 1 | 2007-12-29 Richard Stallman <rms@gnu.org> | 9 | 2007-12-29 Richard Stallman <rms@gnu.org> |
| 2 | 10 | ||
| 3 | * progmodes/compile.el (compilation-start): Set initial visible | 11 | * progmodes/compile.el (compilation-start): Set initial visible |
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 592bccaf517..41cc883c0a4 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -147,7 +147,9 @@ | |||
| 147 | (defun vc-hg-registered (file) | 147 | (defun vc-hg-registered (file) |
| 148 | "Return non-nil if FILE is registered with hg." | 148 | "Return non-nil if FILE is registered with hg." |
| 149 | (when (vc-hg-root file) ; short cut | 149 | (when (vc-hg-root file) ; short cut |
| 150 | (vc-file-setprop file 'vc-state (vc-hg-state file)))) ; expensive | 150 | (let ((state (vc-hg-state file))) ; expensive |
| 151 | (vc-file-setprop file 'vc-state state) | ||
| 152 | (not (memq state '(ignored unregistered)))))) | ||
| 151 | 153 | ||
| 152 | (defun vc-hg-state (file) | 154 | (defun vc-hg-state (file) |
| 153 | "Hg-specific version of `vc-state'." | 155 | "Hg-specific version of `vc-state'." |
| @@ -162,26 +164,26 @@ | |||
| 162 | ;; Ignore all errors. | 164 | ;; Ignore all errors. |
| 163 | (call-process | 165 | (call-process |
| 164 | "hg" nil t nil "--cwd" (file-name-directory file) | 166 | "hg" nil t nil "--cwd" (file-name-directory file) |
| 165 | "status" (file-name-nondirectory file)) | 167 | "status" "-A" (file-name-nondirectory file)) |
| 166 | ;; Some problem happened. E.g. We can't find an `hg' | 168 | ;; Some problem happened. E.g. We can't find an `hg' |
| 167 | ;; executable. | 169 | ;; executable. |
| 168 | (error nil))))))) | 170 | (error nil))))))) |
| 169 | (when (eq 0 status) | 171 | (when (eq 0 status) |
| 170 | (if (eq 0 (length out)) 'up-to-date | ||
| 171 | (when (null (string-match ".*: No such file or directory$" out)) | 172 | (when (null (string-match ".*: No such file or directory$" out)) |
| 172 | (let ((state (aref out 0))) | 173 | (let ((state (aref out 0))) |
| 173 | (cond | 174 | (cond |
| 175 | ((eq state ?C) 'up-to-date) | ||
| 174 | ((eq state ?A) 'edited) | 176 | ((eq state ?A) 'edited) |
| 175 | ((eq state ?M) 'edited) | 177 | ((eq state ?M) 'edited) |
| 176 | ((eq state ?I) 'ignored) | 178 | ((eq state ?I) 'ignored) |
| 177 | ((eq state ?R) 'unregistered) | 179 | ((eq state ?R) 'unregistered) |
| 178 | ((eq state ??) 'unregistered) | 180 | ((eq state ??) 'unregistered) |
| 179 | (t 'up-to-date)))))))) | 181 | (t 'up-to-date))))))) |
| 180 | 182 | ||
| 181 | (defun vc-hg-dir-state (dir) | 183 | (defun vc-hg-dir-state (dir) |
| 182 | (with-temp-buffer | 184 | (with-temp-buffer |
| 183 | (buffer-disable-undo) ;; Because these buffers can get huge | 185 | (buffer-disable-undo) ;; Because these buffers can get huge |
| 184 | (vc-hg-command (current-buffer) nil nil "status") | 186 | (vc-hg-command (current-buffer) nil nil "status" "-A") |
| 185 | (goto-char (point-min)) | 187 | (goto-char (point-min)) |
| 186 | (let ((status-char nil) | 188 | (let ((status-char nil) |
| 187 | (file nil)) | 189 | (file nil)) |