mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 04:21:24 +00:00
vc-dir-recompute-file-state: Return nil state for nonexistent file
* lisp/vc/vc-dir.el (vc-dir-recompute-file-state): Return nil state for nonexistent file (bug#81191).
This commit is contained in:
parent
71ea4bbb6c
commit
466789b511
1 changed files with 14 additions and 10 deletions
|
|
@ -1270,16 +1270,19 @@ that file."
|
|||
|
||||
(defun vc-dir-recompute-file-state (fname def-dir)
|
||||
"Compute state of FNAME known to live inside DEF-DIR."
|
||||
(let* ((file-short (file-relative-name fname def-dir))
|
||||
(_remove-me-when-CVS-works
|
||||
(let ((fname-short (file-relative-name fname def-dir)))
|
||||
(when (eq vc-dir-backend 'CVS)
|
||||
;; FIXME: Warning: UGLY HACK. The CVS backend caches the state
|
||||
;; info, this forces the backend to update it.
|
||||
(vc-call-backend vc-dir-backend 'registered fname)))
|
||||
(state (vc-call-backend vc-dir-backend 'state fname))
|
||||
(extra (vc-call-backend vc-dir-backend
|
||||
'status-fileinfo-extra fname)))
|
||||
(list file-short state extra)))
|
||||
(vc-call-backend vc-dir-backend 'registered fname))
|
||||
;; Ensure we return a nil state if the file does not exist so that
|
||||
;; it disappears from VC-Dir (bug#81191).
|
||||
(if (file-exists-p fname)
|
||||
(list fname-short
|
||||
(vc-call-backend vc-dir-backend 'state fname)
|
||||
(vc-call-backend vc-dir-backend
|
||||
'status-fileinfo-extra fname))
|
||||
(list fname-short nil nil))))
|
||||
|
||||
(defun vc-dir-find-child-files (dirname)
|
||||
;; Give a DIRNAME string return the list of all child files shown in
|
||||
|
|
@ -1339,6 +1342,7 @@ that file."
|
|||
(ewoc-set-hf vc-ewoc
|
||||
(vc-dir-headers vc-dir-backend ddir) ""))
|
||||
(let* ((complete-state
|
||||
;; Pass two truenames (bug#80803, bug#80967).
|
||||
(vc-dir-recompute-file-state file
|
||||
(file-truename ddir)))
|
||||
(state (cadr complete-state)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue