Subject: Re: bug#22481: 25.1.50; vc-hg: emacs "deadlocks" after using hg with huge amounts of ignored files in the repo

From: Dmitry Gutov <[email-masked]>
Date: Fri, 29 Jan 2016 04:53:58 +0300

On 01/28/2016 12:10 PM, Jan Synacek wrote:

> Emacs freezes because it's running 'hg status -mardui -C <files>'. The
> '-i' is the problem here. Since it takes hg itself a very long time, I'm
> not sure if it can be directly fixed in Emacs. But at least a
> configuration option that would allow one to disable the "-i" option
> would be nice.

Haven't we fixed this already? See 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19304, I've fixed what I 
could reproduce.

The current definition of vc-hg-status-files looks like this:

(defun vc-hg-dir-status-files (dir files update-function)
   (apply 'vc-hg-command (current-buffer) 'async dir "status"
          (concat "-mardu" (if files "i"))
          "-C" files)
   (vc-run-delayed
     (vc-hg-after-dir-status update-function)))

IOW, we only pass '-i' when we ask the backend for the status of 
specific files. Which shouldn't be slow.

If it is, I'm pretty sure it's Mercurial's problem.

(You can add a (message "files: %s" files) call at the beginning of 
vc-hg-dir-status-files, to see what file list it's called with.