diff options
| author | Dmitry Gutov | 2020-11-10 18:08:13 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2020-11-10 18:08:13 +0200 |
| commit | bce00552654b603bcea665cd53d08fd60e86772f (patch) | |
| tree | 98d0fae4a1a94e092fbf47a913dc52880563798c | |
| parent | b5b0f07b0a4acd6bdbbaf27744cf0e06f54d3008 (diff) | |
| download | emacs-bce00552654b603bcea665cd53d08fd60e86772f.tar.gz emacs-bce00552654b603bcea665cd53d08fd60e86772f.zip | |
Clear the vc-state cache when returning nil
* lisp/vc/vc-hg.el (vc-hg-registered):
Clear the vc-state cache when returning nil.
| -rw-r--r-- | lisp/vc/vc-hg.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index cacdee22263..67e129044c0 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." | |||
| 223 | "Return non-nil if FILE is registered with hg." | 223 | "Return non-nil if FILE is registered with hg." |
| 224 | (when (vc-hg-root file) ; short cut | 224 | (when (vc-hg-root file) ; short cut |
| 225 | (let ((state (vc-state file 'Hg))) ; expensive | 225 | (let ((state (vc-state file 'Hg))) ; expensive |
| 226 | (and state (not (memq state '(ignored unregistered))))))) | 226 | (if (memq state '(ignored unregistered nil)) |
| 227 | ;; Clear the cache for proper fallback to another backend. | ||
| 228 | (ignore (vc-file-setprop file 'vc-state nil)) | ||
| 229 | t)))) | ||
| 227 | 230 | ||
| 228 | (defun vc-hg-state (file) | 231 | (defun vc-hg-state (file) |
| 229 | "Hg-specific version of `vc-state'." | 232 | "Hg-specific version of `vc-state'." |