mercurial/subrepo.py
changeset 24413 a8595176dd64
parent 24409 30b8db6d0c04
child 24470 76b0b0fed2e3
--- a/mercurial/subrepo.py	Wed Mar 18 22:56:41 2015 -0400
+++ b/mercurial/subrepo.py	Wed Mar 18 23:03:41 2015 -0400
@@ -469,6 +469,10 @@
         """return file flags"""
         return ''
 
+    def printfiles(self, ui, m, fm, fmt):
+        """handle the files command for this subrepo"""
+        return 1
+
     def archive(self, archiver, prefix, match=None):
         if match is not None:
             files = [f for f in self.files() if match(f)]
@@ -848,6 +852,17 @@
         ctx = self._repo[rev]
         return ctx.flags(name)
 
+    @annotatesubrepoerror
+    def printfiles(self, ui, m, fm, fmt):
+        # If the parent context is a workingctx, use the workingctx here for
+        # consistency.
+        if self._ctx.rev() is None:
+            ctx = self._repo[None]
+        else:
+            rev = self._state[1]
+            ctx = self._repo[rev]
+        return cmdutil.files(ui, ctx, m, fm, fmt, True)
+
     def walk(self, match):
         ctx = self._repo[None]
         return ctx.walk(match)