changeset 41626:2c549abc6b85

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
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 07 Feb 2019 09:40:37 -0800
parents 93620a4ba88d
children f92844cb942c
files mercurial/cmdutil.py mercurial/subrepo.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Thu Feb 07 09:46:36 2019 -0800
+++ b/mercurial/cmdutil.py	Thu Feb 07 09:40:37 2019 -0800
@@ -2208,11 +2208,12 @@
                                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:
--- a/mercurial/subrepo.py	Thu Feb 07 09:46:36 2019 -0800
+++ b/mercurial/subrepo.py	Thu Feb 07 09:40:37 2019 -0800
@@ -847,8 +847,7 @@
     @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