1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

Remove extra process call from vc-hg-registered

Prefer vc-state to benefit from its caching (bug#44534)

This same technique is used in vc-git.el,
per commit 2018-06-28 "Remove extra process call from vc-git-find-file-hook"
93c41ce6aa.

* lisp/vc/vc-hg.el (vc-hg-registered): Use vc-state rather than vc-hg-state.
This commit is contained in:
Tom Fitzhenry 2020-11-09 22:19:10 +11:00 committed by Dmitry Gutov
parent f1eca59dfa
commit b5b0f07b0a

View file

@ -222,7 +222,7 @@ If `ask', you will be prompted for a branch type."
(defun vc-hg-registered (file)
"Return non-nil if FILE is registered with hg."
(when (vc-hg-root file) ; short cut
(let ((state (vc-hg-state file))) ; expensive
(let ((state (vc-state file 'Hg))) ; expensive
(and state (not (memq state '(ignored unregistered)))))))
(defun vc-hg-state (file)