[PATCH] extensions: don't fail to load on Windows if path ends with a '\' (issue4187)

Olle olle.lundberg at gmail.com
Wed Mar 5 02:58:56 CST 2014


On Wed, Mar 5, 2014 at 3:27 AM, Siddharth Agarwal <sid0 at fb.com> wrote:

> On 03/04/2014 03:17 PM, Ed Morley wrote:
>
>> # HG changeset patch
>> # User Ed Morley <emorley at mozilla.com>
>> # Date 1393974750 0
>> #      Tue Mar 04 23:12:30 2014 +0000
>> # Node ID 74e8f96578fdad93d682f676441d1b04f1c34901
>> # Parent  5beb49fd5958cd46cb933a8bccf482b56eb55b18
>> extensions: don't fail to load on Windows if path ends with a '\'
>> (issue4187)
>>
>> Same fix as 5c794e7331e7 but now works on Windows too.
>>
>> diff -r 5beb49fd5958 -r 74e8f96578fd mercurial/extensions.py
>> --- a/mercurial/extensions.py
>> +++ b/mercurial/extensions.py
>> @@ -46,7 +46,7 @@ def loadpath(path, module_name):
>>       path = util.expandpath(path)
>>       if os.path.isdir(path):
>>           # module/__init__.py style
>> -        d, f = os.path.split(path.rstrip('/'))
>> +        d, f = os.path.split(path.rstrip(os.sep))
>>
>
> Does this work if you use / at the end on Windows? That should still
> continue to work.


Nope, the patch should probably be something along the lines of:

path = util.normpath(util.expandpath(path))
[...]
d, f = os.path.split(path.rstrip('/'))


>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>



-- 
Olle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140305/5b7f28f2/attachment.html>


More information about the Mercurial-devel mailing list