Subject: bug#62663: 28.2; vc-hg-state returns incorrect results on directories in some repos

From: Sean Whitton <[email-masked]>
Date: Tue, 04 Mar 2025 12:11:23 +0800

tag 62663 - confirmed + moreinfo
thanks

Hello,

On Tue 04 Apr 2023 at 10:05am -04, Spencer Baugh wrote:

> The problem is with vc-hg-state-fast, which parses Mercurial data
> structures instead of shelling out to hg.  This is a great idea but our
> parsing seems to be wrong right now in some way.
>
> 1. Create a new hg repo with:
>
> hg init
>   --config format.use_share_safe=false
>   --config format.use-persistent-nodemap=false
>   --config format.sparse-revlog=false
>   --config format.revlog-compression=zlib
>
> (This is disabling some recent hg features which make vc-hg-state use
> the slow path.  You can verify that vc-hg-state-fast is going to run by
> checking that .hg/requirements is a subset of
> vc-hg-supported-requirements)

ITYM .hg/requires, right?  When I create a repository in this way, that
file contains share-safe, whether or not I pass those --config options.
I've hg 6.3.2 here.

> 2. touch foo && hg add foo && hg commit -m.
> 3. (vc-hg-state-slow ".")
> Returns 'up-to-date which is correct (because it shells out to hg)
> 4. (vc-hg-state ".")
> Returns 'unregistered which is wrong

This recipe doesn't work for me.  Evaluating both of these forms yields
nil.  Evaluating them with "foo" instead of "." yields up-to-date in
both cases.

Is it possible that this problem is only reproducible with newer hg?

Could you confirm your recipe still works, and let me know the version
of hg, please?

Thanks.

-- 
Sean Whitton