[PATCH] subrepo: make sure that the source path is stripped

Augie Fackler durin42 at gmail.com
Wed Feb 10 10:10:21 CST 2010


On Wed, Feb 10, 2010 at 3:35 AM, David Soria Parra <sn_ at gmx.net> wrote:
>
>>>> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
>>>> --- a/mercurial/subrepo.py
>>>> +++ b/mercurial/subrepo.py
>>>> @@ -41,7 +41,7 @@
>>>>                 raise util.Abort(_('missing ] in subrepo source'))
>>>>             kind, src = src.split(']', 1)
>>>>             kind = kind[1:]
>>>> -        state[path] = (src, rev.get(path, ''), kind)
>>>> +        state[path] = (src.strip(), rev.get(path, ''), kind)
>>>
>>> What about source paths that start/end with spaces? It seems silly,
>>> but if nothing else it's worth mentioning in some docs that it won't
>>> work.
>>
>> This is coming out of the config parser, which already strips?
> In the case
>
> foo = [git] bar
>
> the space before bar is not stripped by the parser and I don't think any
> url accepted by subrepos allows spaces.

I think the least surprising option, having slept on this, is to do a
strip, but it might as well be lstrip() since the right is already
stripped.

>
>
>


More information about the Mercurial-devel mailing list