[PATCH] localrepo: make it possible to pass multiple path elements to join and wjoin

Angel Ezquerra angel.ezquerra at gmail.com
Sat Aug 30 01:24:46 CDT 2014


On Fri, Aug 29, 2014 at 10:46 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
> On 08/29/2014 06:07 PM, Angel Ezquerra wrote:
>>>
>>> Is there a use case for this? Will anyone use the extra components?
>>
>> I have a couple of extensions where I do:
>>
>> repo.join(os.path.join('foo', 'bar', 'baz'))
>>
>> Also, it seems that it would be nice to have the same behavior as
>> os.path.join.
>
>
> Without any core usage of it and without any comments, how can we expect it
> to stay that way?

Would you like me to add some comment or docstring to the join and
wjoin functions, explaining the new capability? Actually I think it is
easier to explain what those methods do now that they would behave the
same as os.path.join...

> Anyway, it seems weird if your extensions are the only places where this is
> relevant. I would assume there would be some places in core Mercurial that
> could benefit from this as well.
>
> /Mads

Actually the reason I wrote this patch in the first place is because I
found myself doing:

   os.path.join(repo.join('subs', path)

while writing a patch for core mercurial. I'm sure there are other
places were this would be useful.

Cheers,

Angel


More information about the Mercurial-devel mailing list