emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master bce0055: Clear the vc-state cache when returning nil


From: Dmitry Gutov
Subject: master bce0055: Clear the vc-state cache when returning nil
Date: Tue, 10 Nov 2020 11:09:38 -0500 (EST)

branch: master
commit bce00552654b603bcea665cd53d08fd60e86772f
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Clear the vc-state cache when returning nil
    
    * lisp/vc/vc-hg.el (vc-hg-registered):
    Clear the vc-state cache when returning nil.
---
 lisp/vc/vc-hg.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index cacdee2..67e1290 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -223,7 +223,10 @@ If `ask', you will be prompted for a branch type."
   "Return non-nil if FILE is registered with hg."
   (when (vc-hg-root file)           ; short cut
     (let ((state (vc-state file 'Hg)))  ; expensive
-      (and state (not (memq state '(ignored unregistered)))))))
+      (if (memq state '(ignored unregistered nil))
+          ;; Clear the cache for proper fallback to another backend.
+          (ignore (vc-file-setprop file 'vc-state nil))
+        t))))
 
 (defun vc-hg-state (file)
   "Hg-specific version of `vc-state'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]