mercurial/cmdutil.py
changeset 24413 a8595176dd64
parent 24391 6c3a93e690c7
child 24422 2bdd35ea0a03
--- a/mercurial/cmdutil.py	Wed Mar 18 22:56:41 2015 -0400
+++ b/mercurial/cmdutil.py	Wed Mar 18 23:03:41 2015 -0400
@@ -2261,7 +2261,7 @@
     forgot.extend(f for f in forget if f not in rejected)
     return bad, forgot
 
-def files(ui, ctx, m, fm, fmt):
+def files(ui, ctx, m, fm, fmt, subrepos):
     rev = ctx.rev()
     ret = 1
     ds = ctx.repo().dirstate
@@ -2277,6 +2277,17 @@
         fm.write('path', fmt, m.rel(f))
         ret = 0
 
+    if subrepos:
+        for subpath in sorted(ctx.substate):
+            sub = ctx.sub(subpath)
+            try:
+                submatch = matchmod.narrowmatcher(subpath, m)
+                if sub.printfiles(ui, submatch, fm, fmt) == 0:
+                    ret = 0
+            except error.LookupError:
+                ui.status(_("skipping missing subrepository: %s\n")
+                               % m.abs(subpath))
+
     return ret
 
 def remove(ui, repo, m, prefix, after, force, subrepos):