Subject: bug#66364: closed (Re: bug#66364: 29.1.50; vc-hg-registered/state are slow on directories of large repos)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 14 Oct 2023 17:03:02 +0000

Your bug report

#66364: 29.1.50; vc-hg-registered/state are slow on directories of large repos

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
66364: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66364
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#66364: 29.1.50; vc-hg-registered/state are slow on directories of large repos
From: Dmitry Gutov <[email-masked]>
To: [email-masked]
Cc: Spencer Baugh <[email-masked]>, [email-masked]
Date: Sat, 14 Oct 2023 20:02:16 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

On 13/10/2023 04:09, [email-masked] wrote:
> Yes, I would be quite happy with deleting these unused lines.  Although
> I expect it's still nice to have the same optimization that vc-git does.
> 
> BTW, here's a version of my patch which follows vc-git and just returns
> nil for directories.

Certainly.

Installed both patches, thank you, and closing.

Subject: 29.1.50; vc-hg-registered/state are slow on directories of large repos
From: Spencer Baugh <[email-masked]>
To: [email-masked]
Date: Thu, 05 Oct 2023 11:33:32 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

vc-hg-state (and vc-hg-registered, which calls vc-hg-state) are slow
when run on directories of large repos.  In fact they're O(N) in the
number of files in the repo.

This is because vc-hg-state-slow runs "hg status" on directories in a
mode which lists all the files in the directory, and then it parses that
list.  Which is pointlessly slow.

However, Hg (like git) does not actually track directories.  So in the
end vc-hg-state on a directory should always be returning 'unregistered,
which matches the existing behavior of vc-hg (vc-hg-registered always
returned nil for directories) and is much faster.  (It also matches what
vc-git does.)

A patch to do this will follow