# HG changeset patch # User Thomas Arendsen Hein # Date 1202984730 -3600 # Node ID 3998c1b0828f60d6ef84d8dc43ee763c4862cd63 # Parent f5b00b6e426a058dd983585d4e070a523b420d01 cat --decode: Drop short option, use opts.get() instead of opts[] - hg archive --no-decode has no short option, too, and maybe both could use -d in the future to select revisions by date. - opts.get makes python scripts calling cat() happy, because they don't have to pass the new option. diff -r f5b00b6e426a -r 3998c1b0828f mercurial/commands.py --- a/mercurial/commands.py Sat Feb 09 13:05:22 2008 -0500 +++ b/mercurial/commands.py Thu Feb 14 11:25:30 2008 +0100 @@ -467,7 +467,7 @@ ctx.node()): fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) data = ctx.filectx(abs).data() - if opts['decode']: + if opts.get('decode'): data = repo.wwritedata(abs, data) fp.write(data) err = 0 @@ -2768,7 +2768,7 @@ (cat, [('o', 'output', '', _('print output to file with formatted name')), ('r', 'rev', '', _('print the given revision')), - ('d', 'decode', None, _('apply any matching decode filter')), + ('', 'decode', None, _('apply any matching decode filter')), ] + walkopts, _('hg cat [OPTION]... FILE...')), "^clone": diff -r f5b00b6e426a -r 3998c1b0828f tests/test-dispatch.out --- a/tests/test-dispatch.out Sat Feb 09 13:05:22 2008 -0500 +++ b/tests/test-dispatch.out Thu Feb 14 11:25:30 2008 +0100 @@ -21,7 +21,7 @@ -o --output print output to file with formatted name -r --rev print the given revision - -d --decode apply any matching decode filter + --decode apply any matching decode filter -I --include include names matching the given patterns -X --exclude exclude names matching the given patterns diff -r f5b00b6e426a -r 3998c1b0828f tests/test-encode --- a/tests/test-encode Sat Feb 09 13:05:22 2008 -0500 +++ b/tests/test-encode Thu Feb 14 11:25:30 2008 +0100 @@ -35,8 +35,8 @@ echo %% check hg cat operation hg cat a.gz -hg cat -d a.gz | gunzip +hg cat --decode a.gz | gunzip mkdir subdir cd subdir hg -R .. cat ../a.gz -hg -R .. cat -d ../a.gz | gunzip +hg -R .. cat --decode ../a.gz | gunzip