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

Siddharth Agarwal sid0 at fb.com
Tue Mar 4 20:27:25 CST 2014


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.


More information about the Mercurial-devel mailing list