Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status

From: Dmitry Gutov <[email-masked]>
Date: Fri, 12 May 2023 23:10:05 +0300

On 12/05/2023 22:57, Spencer Baugh wrote:
>> And why cannot we detect the version and dispatch on that, instead of
>> doing this unconditionally?
> hg --version takes a quarter of a second on my machine, which itself
> wipes out a lot of the performance benefit.  We could cache it, but it's
> not clear to me how to do that correctly: there could be different hg
> binaries in different directories, or over TRAMP, or other such things.
> 
> I could add a user option to revert to the old behavior, if you want.

We could cache it like we do with vc-git--program-version. That's a 
simple memoization that doesn't take the host into account (though that 
could be implemented, too).

But it'd really make things easier if we're just allowed to rely on some 
new enough versions of Git and Hg.

> (It would be nice if vc was available on ELPA, then maybe we could just
> tell users of old mercurial versions to downgrade to an old version...)

I don't think so: "ELPA core" packages come from the master branch. 
Emacs 30 will come from it too. The only downgrade that will be 
available to the users of Emacs 30 is to revert to what they have 
bundled. And as soon as we make that change on master, that code will be 
gone.