# HG changeset patch # User Martin von Zweigbergk # Date 2019-02-07 17:40:37 # Node ID 2c549abc6b8551738b1e46ab1812c1f02255eeb4 # Parent 93620a4ba88d3e7b7a33afcf92f193be9ac2c857 subrepo: adjust subrepo prefix before calling subrepo.removefiles() (API) That's what we do with the matcher so it seems more consistent. Differential Revision: https://phab.mercurial-scm.org/D5882 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2208,11 +2208,12 @@ def remove(ui, repo, m, prefix, after, f unit=_('subrepos')) for subpath in subs: submatch = matchmod.subdirmatcher(subpath, m) + subprefix = repo.wvfs.reljoin(prefix, subpath) if subrepos or m.exact(subpath) or any(submatch.files()): progress.increment() sub = wctx.sub(subpath) try: - if sub.removefiles(submatch, prefix, after, force, subrepos, + if sub.removefiles(submatch, subprefix, after, force, subrepos, dryrun, warnings): ret = 1 except error.LookupError: diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -847,8 +847,7 @@ class hgsubrepo(abstractsubrepo): @annotatesubrepoerror def removefiles(self, matcher, prefix, after, force, subrepos, dryrun, warnings): - return cmdutil.remove(self.ui, self._repo, matcher, - self.wvfs.reljoin(prefix, self._path), + return cmdutil.remove(self.ui, self._repo, matcher, prefix, after, force, subrepos, dryrun) @annotatesubrepoerror