comparison mercurial/commands.py @ 32574:3b569745af6c

cat: do not start pager if output will be written to file
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 May 2017 18:52:46 +0900
parents f4cd4c49e302
children 1b90036f42f0
comparison
equal deleted inserted replaced
32573:f4cd4c49e302 32574:3b569745af6c
1362 Returns 0 on success. 1362 Returns 0 on success.
1363 """ 1363 """
1364 ctx = scmutil.revsingle(repo, opts.get('rev')) 1364 ctx = scmutil.revsingle(repo, opts.get('rev'))
1365 m = scmutil.match(ctx, (file1,) + pats, opts) 1365 m = scmutil.match(ctx, (file1,) + pats, opts)
1366 fntemplate = opts.pop('output', '') 1366 fntemplate = opts.pop('output', '')
1367 1367 if cmdutil.isstdiofilename(fntemplate):
1368 ui.pager('cat') 1368 fntemplate = ''
1369
1370 if not fntemplate:
1371 ui.pager('cat')
1369 return cmdutil.cat(ui, repo, ctx, m, fntemplate, '', **opts) 1372 return cmdutil.cat(ui, repo, ctx, m, fntemplate, '', **opts)
1370 1373
1371 @command('^clone', 1374 @command('^clone',
1372 [('U', 'noupdate', None, _('the clone will include an empty working ' 1375 [('U', 'noupdate', None, _('the clone will include an empty working '
1373 'directory (only a repository)')), 1376 'directory (only a repository)')),