comparison mercurial/commands.py @ 6093:f5b00b6e426a

Option --decode for hg cat to apply decode filters. (Does not trigger expansion of keyword arguments when using keyword extension, though that might be desirable as well.)
author Jesse Glick <jesse.glick@sun.com>
date Sat, 09 Feb 2008 13:05:22 -0500
parents ea33f695304a
children 3998c1b0828f
comparison
equal deleted inserted replaced
6092:911f5be5d159 6093:f5b00b6e426a
464 ctx = repo.changectx(opts['rev']) 464 ctx = repo.changectx(opts['rev'])
465 err = 1 465 err = 1
466 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts, 466 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts,
467 ctx.node()): 467 ctx.node()):
468 fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) 468 fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs)
469 fp.write(ctx.filectx(abs).data()) 469 data = ctx.filectx(abs).data()
470 if opts['decode']:
471 data = repo.wwritedata(abs, data)
472 fp.write(data)
470 err = 0 473 err = 0
471 return err 474 return err
472 475
473 def clone(ui, source, dest=None, **opts): 476 def clone(ui, source, dest=None, **opts):
474 """make a copy of an existing repository 477 """make a copy of an existing repository
2763 _('hg bundle [-f] [-r REV]... [--base REV]... FILE [DEST]')), 2766 _('hg bundle [-f] [-r REV]... [--base REV]... FILE [DEST]')),
2764 "cat": 2767 "cat":
2765 (cat, 2768 (cat,
2766 [('o', 'output', '', _('print output to file with formatted name')), 2769 [('o', 'output', '', _('print output to file with formatted name')),
2767 ('r', 'rev', '', _('print the given revision')), 2770 ('r', 'rev', '', _('print the given revision')),
2771 ('d', 'decode', None, _('apply any matching decode filter')),
2768 ] + walkopts, 2772 ] + walkopts,
2769 _('hg cat [OPTION]... FILE...')), 2773 _('hg cat [OPTION]... FILE...')),
2770 "^clone": 2774 "^clone":
2771 (clone, 2775 (clone,
2772 [('U', 'noupdate', None, _('do not update the new working directory')), 2776 [('U', 'noupdate', None, _('do not update the new working directory')),