From: Dan Nicolaescu Date: Tue, 1 Jun 2010 07:15:55 +0000 (-0700) Subject: * vc-dir.el (vc-dir-update): Remove entries with a nil state (bug#5539). X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~158 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=290736f2dcb373a86e8043c0021819a7f775513f;p=emacs.git * vc-dir.el (vc-dir-update): Remove entries with a nil state (bug#5539). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11316a24222..f4186e16bef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-06-01 Dan Nicolaescu + + * vc-dir.el (vc-dir-update): Remove entries with a nil state (bug#5539). + 2010-06-01 Stefan Monnier * 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." ;; Insert directory entries in the right places. (let ((entry (car entries)) (node (ewoc-nth vc-ewoc 0)) + (to-remove nil) (dotname (file-relative-name default-directory))) ;; Insert . if it is not present. (unless node @@ -388,10 +389,16 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." ((string-lessp nodefile entryfile) (setq node (ewoc-next vc-ewoc node))) ((string-equal nodefile entryfile) - (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) - (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) - (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) - (ewoc-invalidate vc-ewoc node) + (if (nth 1 entry) + (progn + (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) + (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) + (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) + (ewoc-invalidate vc-ewoc node)) + ;; If the state is nil, the file does not exist + ;; anymore, so remember the entry so we can remove + ;; it after we are done inserting all ENTRIES. + (push node to-remove)) (setq entries (cdr entries)) (setq entry (car entries)) (setq node (ewoc-next vc-ewoc node))) @@ -427,7 +434,10 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." vc-ewoc (vc-dir-create-fileinfo rd nil nil nil entrydir)))) ;; Now insert the node itself. (ewoc-enter-last vc-ewoc - (apply 'vc-dir-create-fileinfo entry))))))))) + (apply 'vc-dir-create-fileinfo entry)))))) + (when to-remove + (let ((inhibit-read-only t)) + (apply 'ewoc-delete vc-ewoc (nreverse to-remove))))))) (defun vc-dir-busy () (and (buffer-live-p vc-dir-process-buffer)