mercurial/commands.py
changeset 32541 3b569745af6c
parent 32540 f4cd4c49e302
child 32566 1b90036f42f0
--- a/mercurial/commands.py	Sat May 27 18:50:05 2017 +0900
+++ b/mercurial/commands.py	Sat May 27 18:52:46 2017 +0900
@@ -1364,8 +1364,11 @@
     ctx = scmutil.revsingle(repo, opts.get('rev'))
     m = scmutil.match(ctx, (file1,) + pats, opts)
     fntemplate = opts.pop('output', '')
-
-    ui.pager('cat')
+    if cmdutil.isstdiofilename(fntemplate):
+        fntemplate = ''
+
+    if not fntemplate:
+        ui.pager('cat')
     return cmdutil.cat(ui, repo, ctx, m, fntemplate, '', **opts)
 
 @command('^clone',