[PATCH] forget: use forward slashes for internal paths
Mads Kiilerich
mads at kiilerich.com
Mon Nov 14 19:50:41 CST 2011
Mads Kiilerich wrote, On 11/15/2011 02:47 AM:
> # HG changeset patch
> # User Mads Kiilerich<mads at kiilerich.com>
> # Date 1321321495 -3600
> # Node ID 5824f6a9565a05e964e872b26a8f7371682a5865
> # Parent 1bb0a5b02da9ef3505bfb4ac02b2d51cf220220f
> forget: use forward slashes for internal paths
>
> forget into a subrepo failed on windows because pathes were joined with \.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -2446,7 +2446,7 @@
> submatch = matchmod.narrowmatcher(subpath, m)
> for fsub in sub.walk(submatch):
> if submatch.exact(fsub):
> - subforget[os.path.join(subpath, fsub)] = (fsub, sub)
> + subforget[subpath + '/' + fsub] = (fsub, sub)
> except error.LookupError:
> ui.status(_("skipping missing subrepository: %s\n") % subpath)
>
I guess this could be fixed in other ways, but this is a simple way to
do it.
But it seems like it would be convenient and better to have a more
subrepo-aware matcher that could encapsulate this.
/Mads
More information about the Mercurial-devel
mailing list