diff mercurial/subrepo.py @ 32540:f4cd4c49e302

cat: pass filename template as explicit argument I'll move the handling of the '-' filename to commands.cat().
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 May 2017 18:50:05 +0900
parents 09fb3d3b1b3a
children 746e12a767b3
line wrap: on
line diff
--- a/mercurial/subrepo.py	Thu May 25 21:28:08 2017 +0900
+++ b/mercurial/subrepo.py	Sat May 27 18:50:05 2017 +0900
@@ -538,7 +538,7 @@
         self.ui.warn("%s: %s" % (prefix, _("addremove is not supported")))
         return 1
 
-    def cat(self, match, prefix, **opts):
+    def cat(self, match, fntemplate, prefix, **opts):
         return 1
 
     def status(self, rev2, **opts):
@@ -767,10 +767,11 @@
                                  dry_run, similarity)
 
     @annotatesubrepoerror
-    def cat(self, match, prefix, **opts):
+    def cat(self, match, fntemplate, prefix, **opts):
         rev = self._state[1]
         ctx = self._repo[rev]
-        return cmdutil.cat(self.ui, self._repo, ctx, match, prefix, **opts)
+        return cmdutil.cat(self.ui, self._repo, ctx, match, fntemplate, prefix,
+                           **opts)
 
     @annotatesubrepoerror
     def status(self, rev2, **opts):
@@ -1832,7 +1833,7 @@
 
 
     @annotatesubrepoerror
-    def cat(self, match, prefix, **opts):
+    def cat(self, match, fntemplate, prefix, **opts):
         rev = self._state[1]
         if match.anypats():
             return 1 #No support for include/exclude yet
@@ -1842,7 +1843,7 @@
 
         for f in match.files():
             output = self._gitcommand(["show", "%s:%s" % (rev, f)])
-            fp = cmdutil.makefileobj(self._subparent, opts.get('output'),
+            fp = cmdutil.makefileobj(self._subparent, fntemplate,
                                      self._ctx.node(),
                                      pathname=self.wvfs.reljoin(prefix, f))
             fp.write(output)