Patchwork D5882: subrepo: adjust subrepo prefix before calling subrepo.removefiles() (API)

login
register
mail settings
Submitter phabricator
Date Feb. 9, 2019, 9:45 p.m.
Message ID <6833002e9460f289b71253bfde5a3ba4@localhost.localdomain>
Download mbox | patch
Permalink /patch/38592/
State Not Applicable
Headers show

Comments

phabricator - Feb. 9, 2019, 9:45 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2c549abc6b85: subrepo: adjust subrepo prefix before calling subrepo.removefiles() (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5882?vs=13893&id=13956

REVISION DETAIL
  https://phab.mercurial-scm.org/D5882

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/subrepo.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -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
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -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: