[PATCH stable] subrepo: use standard handling of \ in subpath replacement strings (BC)

Mads Kiilerich mads at kiilerich.com
Mon Jul 30 07:35:59 CDT 2012


On 30/07/12 03:55, Matt Mackall wrote:
> On Mon, 2012-07-30 at 03:18 +0200, Mads Kiilerich wrote:
>> Matt Mackall wrote, On 07/27/2012 09:07 PM:
>>> On Thu, 2012-07-26 at 02:57 +0200, Mads Kiilerich wrote:
>>>> # HG changeset patch
>>>> # User Mads Kiilerich <mads at kiilerich.com>
>>>> # Date 1343264252 -7200
>>>> # Branch stable
>>>> # Node ID 1de046d28995fb6c5af554882d2c5ec14b364ece
>>>> # Parent  1675ef8a2bf2e32e9f42aa3a74b48c0f44ff9b80
>>>> subrepo: use standard handling of \ in subpath replacement strings (BC)
>>> So if I've checked in a .hgsub file which contains replacement patterns
>>> using backslashes, I won't be able to check it out after upgrading?
>>>
>>> That seems a rather big deal.
>> Negative. All sane setups will work as before.
> Yes... but where does that leave Windows users? </rimshot>
>
> Really, even as bad as the current state is, if there's a non-trivial
> risk it's going to mean people can't check out what they checked in
> after upgrading (definitely a cardinal sin for an SCM), I'm not going to
> buy it. Given how many Windows users have reported using "\" in their
> subrepo config and the fact that this misfeature was clearly introduced
> _for the benefit of Windows users_ (probably for one of Martin's
> clients!), I have basically no confidence that Windows users aren't
> dependent on this.

Yes, some Windows users might depend on the misfeature. But Windows 
users that realize that the sane way to specify paths in Mercurial is by 
using / will be fine.

\ can not be used as path element separator on the left hand side and 
there is no reason to expect that it can be used on the right hand side. 
Especially not when it is documented that \ is used for other purposes.

>> ... But agreed, still possibly a rather big deal for those who have
>> worked around the previous undocumented behaviour and now rely on it.
>> Having to deal with the old behaviour is however also a big deal.
> We have a rule that decides this situation: regressions trump other
> bugs. Corollary: old users trump new users.
>

FWIW: I don't consider it a regression to fix undocumented and 
"obviously" wrong behaviour. That is why I propose a BC.

Ok. The problem and the opinions on it is now quite well understood. It 
is your call whether you want this corner to suck forever or if you want 
to have one upgrade that might suck for a few users.

A compromise could be to check if if the replacement string contains any 
single \ without a following digit and in that case keep the old 
behaviour and issue a warning. Users can fix their .hgsub configuration 
in tip and will only see the warning when they update back to old revisions.

/Mads



More information about the Mercurial-devel mailing list