--- a/mercurial/commands.py Sat May 27 17:58:36 2017 +0900
+++ b/mercurial/commands.py Thu May 25 21:53:44 2017 +0900
@@ -35,6 +35,7 @@
error,
exchange,
extensions,
+ formatter,
graphmod,
hbisect,
help,
@@ -1338,7 +1339,7 @@
_('print output to file with formatted name'), _('FORMAT')),
('r', 'rev', '', _('print the given revision'), _('REV')),
('', 'decode', None, _('apply any matching decode filter')),
- ] + walkopts,
+ ] + walkopts + formatteropts,
_('[OPTION]... FILE...'),
inferrepo=True)
def cat(ui, repo, file1, *pats, **opts):
@@ -1368,9 +1369,13 @@
if cmdutil.isstdiofilename(fntemplate):
fntemplate = ''
- if not fntemplate:
+ if fntemplate:
+ fm = formatter.nullformatter(ui, 'cat')
+ else:
ui.pager('cat')
- return cmdutil.cat(ui, repo, ctx, m, fntemplate, '', **opts)
+ fm = ui.formatter('cat', opts)
+ with fm:
+ return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '', **opts)
@command('^clone',
[('U', 'noupdate', None, _('the clone will include an empty working '