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

Markus Zapke-Gründemann markuszapke at gmx.net
Wed Oct 10 11:39:54 CDT 2012

Matt Mackall schrieb:
> On Thu, 2012-08-30 at 11:47 +0200, Martin Geisler wrote:
>> Matt Mackall <mpm at selenic.com> writes:
>>> On Mon, 2012-07-30 at 14:35 +0200, Mads Kiilerich wrote:
>>>> 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.
>>> As I said before, this misfeature was introduced on purpose, probably
>>> for a customer of Martin's.
>> Yes, the feature was implemented for Lantiq. I don't remember exactly
>> whos idea it was to make \N special like this and I don't know if they
>> rely on this functionality.
> Well, it's not so much that \N is special, because it's already a regex
> replacement string, it's that string-escape is used to try to make
> Windows users happy in a way that introduces surprises.
> If Lantiq has _never_ used this feature, great, that brings my
> confidence that reverting this change is safe from about 5% to about
> 40%. Necessary but not sufficient. Experience has shown that Windows
> users will try to use backslashes wherever possible, regardless of what
> the docs say. So if the intersection of Windows users and [subpaths]
> users is not empty, there will be people who get bit.
At Lantiq we use only forward slashes in subrepo replacement patterns. And even
if we used backward slashes it could be easily fixed because all subpath
replacement patterns are defined in projrc files.



More information about the Mercurial-devel mailing list