diff -r f4cd4c49e302 -r 3b569745af6c mercurial/commands.py --- 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',