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

Ed Morley emorley at mozilla.com
Wed Mar 5 03:15:14 CST 2014


On 05 March 2014 08:58:56, Olle wrote:
> Nope, the patch should probably be something along the lines of:
>
> path = util.normpath(util.expandpath(path))
> [...]
> d, f = os.path.split(path.rstrip('/')__)

Ah it hadn't occurred to me that using forward slashes on Windows would 
ever work - but checking shows that .split works on any separator, not 
just os.sep - so agree we should use normpath() then.

That makes the rstrip() redundant, since normpath() drops trailing 
slashes in addition to converting forward to backward slashes.

Not sure what the protocol is for updating patches, so will follow up 
in a separate email with it. (Used to the Bugzilla attachment with 
splinter review and tools for exporting to/from hg/bugzilla workflow).

Ed


More information about the Mercurial-devel mailing list