Subject: Re: bug#79024: 31.0.50; Multiple working trees support for VC

From: Sean Whitton <[email-masked]>
Date: Sat, 16 Aug 2025 14:22:52 +0100

Hello,

On Sat 16 Aug 2025 at 03:12pm +03, Eli Zaretskii wrote:

>> From: Sean Whitton <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Sat, 16 Aug 2025 12:46:04 +0100
>>
>> >   Checking in foo...
>> >   abort: no username supplied
>> >   (use 'hg config --edit' to set your username)
>>
>> Looks like the problem is determining the committer identity.
>>
>> I think the attached patch will fix this.  I've tested it locally and it
>> does result in the test commits having the [email-masked] identity.
>> Could you test it on Windows?  Thanks.
>
> I guess I should test this together with the previous patch you sent
> for vc-hg.el?

Right.

> I still get a failure in that test, but a different one now:
>
>   Test vc-test-hg07-other-working-trees condition:
>       (ert-test-failed
>        ((should (equal (list second) (vc-call-backend backend ...))) :form
> 	(equal ("c:/Users/EliZ/AppData/Local/Temp/vc-testQIJW1t/second/")
> 	       nil)
> 	:value nil :explanation
> 	(different-types
> 	 ("c:/Users/EliZ/AppData/Local/Temp/vc-testQIJW1t/second/") nil)))
>      FAILED  32/56  vc-test-hg07-other-working-trees (0.592570 sec) at lisp/vc/vc-tests/vc-tests.el:1
>
> HTH

It does, thanks.  So, looks like my implementation of the coding systems
hack for Mercurial is fine.  So I've installed that.

Then I think what we have is an actual bug instead of just a test suite
problem.  One or both of vc-hg-add-working-tree and
vc-hg-known-other-working-trees don't work on Windows.  I suspect that
it is the latter.

Could you take a glance over vc-hg-known-other-working-trees and see if
perhaps it is making obviously invalid assumptions about Windows paths?

If that doesn't reveal anything, I'd like to ask you to try manually
creating a new working tree, from Emacs, to rule out any problems with
vc-hg-add-working-tree.  Something like this:

- M-x mkdir RET ~/foo RET
- C-x C-f ~/foo/bar RET blah C-x C-s
- C-x v v
  + it should prompt for the backend, choose Hg
- C-x v v blahblah C-c C-c
  + checks in the file
- C-x v w c foo2 RET

Now check that there is a new tree foo/../foo2/ (or wherever you put it)
and that the file foo/../foo2/.hg/sharedpath contains the path of the
original foo.  If there is then we can be pretty sure the problem is
vc-hg-known-other-working-trees.

-- 
Sean Whitton