diff mercurial/scmutil.py @ 23539:cb42050f2dad

addremove: support addremove with explicit paths in subrepos Git and svn subrepos are currently not supported.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 09 Nov 2014 23:46:25 -0500
parents f1b06a8aad42
children aed981c7bebf
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon Nov 24 23:51:26 2014 -0500
+++ b/mercurial/scmutil.py	Sun Nov 09 23:46:25 2014 -0500
@@ -723,9 +723,17 @@
     ret = 0
     join = lambda f: os.path.join(prefix, f)
 
+    def matchessubrepo(matcher, subpath):
+        if matcher.exact(subpath):
+            return True
+        for f in matcher.files():
+            if f.startswith(subpath):
+                return True
+        return False
+
     wctx = repo[None]
     for subpath in sorted(wctx.substate):
-        if opts.get('subrepos'):
+        if opts.get('subrepos') or matchessubrepo(m, subpath):
             sub = wctx.sub(subpath)
             try:
                 submatch = matchmod.narrowmatcher(subpath, m)