mercurial/subrepo.py
changeset 24778 a48b65ab428d
parent 24726 747748766421
child 24785 39f519be5e65
--- a/mercurial/subrepo.py	Sun Apr 12 19:00:31 2015 +0900
+++ b/mercurial/subrepo.py	Tue Apr 14 20:09:56 2015 +0200
@@ -1779,17 +1779,15 @@
         if node2:
             cmd.append(node2)
 
-        if match.anypats():
-            return #No support for include/exclude yet
-
         output = ""
         if match.always():
             output += self._gitcommand(cmd) + '\n'
-        elif match.files():
-            for f in match.files():
-                output += self._gitcommand(cmd + [f]) + '\n'
-        elif match(gitprefix): #Subrepo is matched
-            output += self._gitcommand(cmd) + '\n'
+        else:
+            st = self.status(node2)[:3]
+            files = [f for sublist in st for f in sublist]
+            for f in files:
+                if match(f):
+                    output += self._gitcommand(cmd + ['--', f]) + '\n'
 
         if output.strip():
             ui.write(output)