Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 23326:f6b8d23492e5
remove: support remove with explicit paths in subrepos
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 12 Nov 2014 23:15:20 -0500 |
parents | 4165cfd67519 |
children | bd296bb4b5c8 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Nov 15 21:36:19 2014 -0500 +++ b/mercurial/cmdutil.py Wed Nov 12 23:15:20 2014 -0500 @@ -2060,8 +2060,16 @@ wctx = repo[None] - if subrepos: - for subpath in sorted(wctx.substate): + for subpath in sorted(wctx.substate): + def matchessubrepo(matcher, subpath): + if matcher.exact(subpath): + return True + for f in matcher.files(): + if f.startswith(subpath): + return True + return False + + if subrepos or matchessubrepo(m, subpath): sub = wctx.sub(subpath) try: submatch = matchmod.narrowmatcher(subpath, m) @@ -2080,7 +2088,7 @@ return True return False - if f in repo.dirstate or f in wctx.dirs() or (subrepos and insubrepo()): + if f in repo.dirstate or f in wctx.dirs() or insubrepo(): continue if os.path.exists(m.rel(join(f))):