diff options
| author | Dan Nicolaescu | 2010-06-01 00:15:55 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-06-01 00:15:55 -0700 |
| commit | 290736f2dcb373a86e8043c0021819a7f775513f (patch) | |
| tree | 9104721f827a87f864f8421824ba6d4b59cedfec /lisp | |
| parent | fd67a7000ee9e118b426df6ad779f3c86d4fe320 (diff) | |
| download | emacs-290736f2dcb373a86e8043c0021819a7f775513f.tar.gz emacs-290736f2dcb373a86e8043c0021819a7f775513f.zip | |
* vc-dir.el (vc-dir-update): Remove entries with a nil state (bug#5539).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc-dir.el | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11316a24222..f4186e16bef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-06-01 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc-dir.el (vc-dir-update): Remove entries with a nil state (bug#5539). | ||
| 4 | |||
| 1 | 2010-06-01 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2010-06-01 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * vc-bzr.el (vc-bzr-revision-completion-table): Apply | 7 | * vc-bzr.el (vc-bzr-revision-completion-table): Apply |
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el index 5809110e5b5..44f0fed0806 100644 --- a/lisp/vc-dir.el +++ b/lisp/vc-dir.el | |||
| @@ -362,6 +362,7 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." | |||
| 362 | ;; Insert directory entries in the right places. | 362 | ;; Insert directory entries in the right places. |
| 363 | (let ((entry (car entries)) | 363 | (let ((entry (car entries)) |
| 364 | (node (ewoc-nth vc-ewoc 0)) | 364 | (node (ewoc-nth vc-ewoc 0)) |
| 365 | (to-remove nil) | ||
| 365 | (dotname (file-relative-name default-directory))) | 366 | (dotname (file-relative-name default-directory))) |
| 366 | ;; Insert . if it is not present. | 367 | ;; Insert . if it is not present. |
| 367 | (unless node | 368 | (unless node |
| @@ -388,10 +389,16 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." | |||
| 388 | ((string-lessp nodefile entryfile) | 389 | ((string-lessp nodefile entryfile) |
| 389 | (setq node (ewoc-next vc-ewoc node))) | 390 | (setq node (ewoc-next vc-ewoc node))) |
| 390 | ((string-equal nodefile entryfile) | 391 | ((string-equal nodefile entryfile) |
| 391 | (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) | 392 | (if (nth 1 entry) |
| 392 | (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) | 393 | (progn |
| 393 | (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) | 394 | (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) |
| 394 | (ewoc-invalidate vc-ewoc node) | 395 | (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) |
| 396 | (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) | ||
| 397 | (ewoc-invalidate vc-ewoc node)) | ||
| 398 | ;; If the state is nil, the file does not exist | ||
| 399 | ;; anymore, so remember the entry so we can remove | ||
| 400 | ;; it after we are done inserting all ENTRIES. | ||
| 401 | (push node to-remove)) | ||
| 395 | (setq entries (cdr entries)) | 402 | (setq entries (cdr entries)) |
| 396 | (setq entry (car entries)) | 403 | (setq entry (car entries)) |
| 397 | (setq node (ewoc-next vc-ewoc node))) | 404 | (setq node (ewoc-next vc-ewoc node))) |
| @@ -427,7 +434,10 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." | |||
| 427 | vc-ewoc (vc-dir-create-fileinfo rd nil nil nil entrydir)))) | 434 | vc-ewoc (vc-dir-create-fileinfo rd nil nil nil entrydir)))) |
| 428 | ;; Now insert the node itself. | 435 | ;; Now insert the node itself. |
| 429 | (ewoc-enter-last vc-ewoc | 436 | (ewoc-enter-last vc-ewoc |
| 430 | (apply 'vc-dir-create-fileinfo entry))))))))) | 437 | (apply 'vc-dir-create-fileinfo entry)))))) |
| 438 | (when to-remove | ||
| 439 | (let ((inhibit-read-only t)) | ||
| 440 | (apply 'ewoc-delete vc-ewoc (nreverse to-remove))))))) | ||
| 431 | 441 | ||
| 432 | (defun vc-dir-busy () | 442 | (defun vc-dir-busy () |
| 433 | (and (buffer-live-p vc-dir-process-buffer) | 443 | (and (buffer-live-p vc-dir-process-buffer) |