Patchwork D5885: subrepo: adjust subrepo prefix before calling subrepo.addremove() (API)

login
register
mail settings
Submitter phabricator
Date Feb. 9, 2019, 9:45 p.m.
Message ID <ea54b147c227a2032d313845552f1d91@localhost.localdomain>
Download mbox | patch
Permalink /patch/38595/
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 rHG5ee3c49fc9cd: subrepo: adjust subrepo prefix before calling subrepo.addremove() (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5885?vs=13896&id=13959

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

AFFECTED FILES
  mercurial/scmutil.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
@@ -527,8 +527,7 @@ 
         # be used to process sibling subrepos however.
         opts = copy.copy(opts)
         opts['subrepos'] = True
-        return scmutil.addremove(self._repo, m,
-                                 self.wvfs.reljoin(prefix, self._path), opts)
+        return scmutil.addremove(self._repo, m, prefix, opts)
 
     @annotatesubrepoerror
     def cat(self, match, fm, fntemplate, prefix, **opts):
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1047,8 +1047,9 @@ 
         submatch = matchmod.subdirmatcher(subpath, m)
         if opts.get('subrepos') or m.exact(subpath) or any(submatch.files()):
             sub = wctx.sub(subpath)
+            subprefix = repo.wvfs.reljoin(prefix, subpath)
             try:
-                if sub.addremove(submatch, prefix, opts):
+                if sub.addremove(submatch, subprefix, opts):
                     ret = 1
             except error.LookupError:
                 repo.ui.status(_("skipping missing subrepository: %s\n")