changeset 41629:5ee3c49fc9cd

subrepo: adjust subrepo prefix before calling subrepo.addremove() (API) Differential Revision: https://phab.mercurial-scm.org/D5885
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 07 Feb 2019 10:01:55 -0800
parents ed046348675c
children 3d094bfaf885
files mercurial/scmutil.py mercurial/subrepo.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Thu Feb 07 09:59:27 2019 -0800
+++ b/mercurial/scmutil.py	Thu Feb 07 10:01:55 2019 -0800
@@ -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")
--- a/mercurial/subrepo.py	Thu Feb 07 09:59:27 2019 -0800
+++ b/mercurial/subrepo.py	Thu Feb 07 10:01:55 2019 -0800
@@ -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):