1336 @command('cat', |
1337 @command('cat', |
1337 [('o', 'output', '', |
1338 [('o', 'output', '', |
1338 _('print output to file with formatted name'), _('FORMAT')), |
1339 _('print output to file with formatted name'), _('FORMAT')), |
1339 ('r', 'rev', '', _('print the given revision'), _('REV')), |
1340 ('r', 'rev', '', _('print the given revision'), _('REV')), |
1340 ('', 'decode', None, _('apply any matching decode filter')), |
1341 ('', 'decode', None, _('apply any matching decode filter')), |
1341 ] + walkopts, |
1342 ] + walkopts + formatteropts, |
1342 _('[OPTION]... FILE...'), |
1343 _('[OPTION]... FILE...'), |
1343 inferrepo=True) |
1344 inferrepo=True) |
1344 def cat(ui, repo, file1, *pats, **opts): |
1345 def cat(ui, repo, file1, *pats, **opts): |
1345 """output the current or given revision of files |
1346 """output the current or given revision of files |
1346 |
1347 |
1366 m = scmutil.match(ctx, (file1,) + pats, opts) |
1367 m = scmutil.match(ctx, (file1,) + pats, opts) |
1367 fntemplate = opts.pop('output', '') |
1368 fntemplate = opts.pop('output', '') |
1368 if cmdutil.isstdiofilename(fntemplate): |
1369 if cmdutil.isstdiofilename(fntemplate): |
1369 fntemplate = '' |
1370 fntemplate = '' |
1370 |
1371 |
1371 if not fntemplate: |
1372 if fntemplate: |
|
1373 fm = formatter.nullformatter(ui, 'cat') |
|
1374 else: |
1372 ui.pager('cat') |
1375 ui.pager('cat') |
1373 return cmdutil.cat(ui, repo, ctx, m, fntemplate, '', **opts) |
1376 fm = ui.formatter('cat', opts) |
|
1377 with fm: |
|
1378 return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '', **opts) |
1374 |
1379 |
1375 @command('^clone', |
1380 @command('^clone', |
1376 [('U', 'noupdate', None, _('the clone will include an empty working ' |
1381 [('U', 'noupdate', None, _('the clone will include an empty working ' |
1377 'directory (only a repository)')), |
1382 'directory (only a repository)')), |
1378 ('u', 'updaterev', '', _('revision, tag, or branch to check out'), |
1383 ('u', 'updaterev', '', _('revision, tag, or branch to check out'), |