Directories are never tracked in hg, so it's pointless to run
vc-hg-state on them. And, in fact, our implementation previously
would list all the files contained in the directory and then parse
that in Emacs, which is very slow in large repos.
Let's just use the knowledge that directories aren't tracked in hg,
and skip running hg entirely.
* lisp/vc/vc-hg.el (vc-hg-state): Return nil for
directories. (Bug#66364)
(defun vc-hg-state (file)
"Hg-specific version of `vc-state'."
- (let ((state (vc-hg-state-fast file)))
- (if (eq state 'unsupported) (vc-hg-state-slow file) state)))
+ (unless (file-directory-p file)
+ (let ((state (vc-hg-state-fast file)))
+ (if (eq state 'unsupported) (vc-hg-state-slow file) state))))
(defun vc-hg-state-slow (file)
"Determine status of FILE by running hg."