From: Tom Fitzhenry Date: Mon, 9 Nov 2020 11:19:10 +0000 (+1100) Subject: Remove extra process call from vc-hg-registered X-Git-Tag: emacs-28.0.90~5196 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5b0f07b0a4acd6bdbbaf27744cf0e06f54d3008;p=emacs.git 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" 93c41ce6aa64b14fc9bd7bdd0d909915a79191cd. * lisp/vc/vc-hg.el (vc-hg-registered): Use vc-state rather than vc-hg-state. --- diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index cb0657e70a0..cacdee22263 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -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)