comparison mercurial/commands.py @ 3182:a73a785ea8e1

factor opts: --dry-run option
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 29 Sep 2006 18:39:49 +0200
parents 725e3d3145d8
children 37b53487c341 f2ed26736dfa
comparison
equal deleted inserted replaced
3181:725e3d3145d8 3182:a73a785ea8e1
2670 ('', 'profile', None, _('print command execution profile')), 2670 ('', 'profile', None, _('print command execution profile')),
2671 ('', 'version', None, _('output version information and exit')), 2671 ('', 'version', None, _('output version information and exit')),
2672 ('h', 'help', None, _('display help and exit')), 2672 ('h', 'help', None, _('display help and exit')),
2673 ] 2673 ]
2674 2674
2675 dryrunopts = [('n', 'dry-run', None,
2676 _('do not perform actions, just print output'))]
2677
2675 walkopts = [ 2678 walkopts = [
2676 ('I', 'include', [], _('include names matching the given patterns')), 2679 ('I', 'include', [], _('include names matching the given patterns')),
2677 ('X', 'exclude', [], _('exclude names matching the given patterns')), 2680 ('X', 'exclude', [], _('exclude names matching the given patterns')),
2678 ] 2681 ]
2679 2682
2680 table = { 2683 table = {
2681 "^add": 2684 "^add":
2682 (add, 2685 (add,
2683 walkopts + \ 2686 walkopts + dryrunopts,
2684 [('n', 'dry-run', None,
2685 _('do not perform actions, just print output'))],
2686 _('hg add [OPTION]... [FILE]...')), 2687 _('hg add [OPTION]... [FILE]...')),
2687 "addremove": 2688 "addremove":
2688 (addremove, 2689 (addremove,
2689 walkopts + \ 2690 walkopts + dryrunopts +
2690 [('n', 'dry-run', None,
2691 _('do not perform actions, just print output'))],
2692 [('s', 'similarity', '', 2691 [('s', 'similarity', '',
2693 _('guess renamed files by similarity (0<=s<=100)'))], 2692 _('guess renamed files by similarity (0<=s<=100)')),
2693 ] + walkopts + dryrunopts,
2694 _('hg addremove [OPTION]... [FILE]...')), 2694 _('hg addremove [OPTION]... [FILE]...')),
2695 "^annotate": 2695 "^annotate":
2696 (annotate, 2696 (annotate,
2697 [('r', 'rev', '', _('annotate the specified revision')), 2697 [('r', 'rev', '', _('annotate the specified revision')),
2698 ('f', 'follow', None, _('follow file copies and renames')), 2698 ('f', 'follow', None, _('follow file copies and renames')),
2758 "copy|cp": 2758 "copy|cp":
2759 (copy, 2759 (copy,
2760 [('A', 'after', None, _('record a copy that has already occurred')), 2760 [('A', 'after', None, _('record a copy that has already occurred')),
2761 ('f', 'force', None, 2761 ('f', 'force', None,
2762 _('forcibly copy over an existing managed file')), 2762 _('forcibly copy over an existing managed file')),
2763 ('n', 'dry-run', None, _('do not perform actions, just print output'))], 2763 ] + walkopts + dryrunopts,
2764 ] + walkopts,
2765 _('hg copy [OPTION]... [SOURCE]... DEST')), 2764 _('hg copy [OPTION]... [SOURCE]... DEST')),
2766 "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')), 2765 "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')),
2767 "debugcomplete": 2766 "debugcomplete":
2768 (debugcomplete, 2767 (debugcomplete,
2769 [('o', 'options', None, _('show the command options'))], 2768 [('o', 'options', None, _('show the command options'))],
2952 "rename|mv": 2951 "rename|mv":
2953 (rename, 2952 (rename,
2954 [('A', 'after', None, _('record a rename that has already occurred')), 2953 [('A', 'after', None, _('record a rename that has already occurred')),
2955 ('f', 'force', None, 2954 ('f', 'force', None,
2956 _('forcibly copy over an existing managed file')), 2955 _('forcibly copy over an existing managed file')),
2957 ('n', 'dry-run', None, _('do not perform actions, just print output'))], 2956 ] + walkopts + dryrunopts,
2958 ] + walkopts,
2959 _('hg rename [OPTION]... SOURCE... DEST')), 2957 _('hg rename [OPTION]... SOURCE... DEST')),
2960 "^revert": 2958 "^revert":
2961 (revert, 2959 (revert,
2962 [('a', 'all', None, _('revert all changes when no arguments given')), 2960 [('a', 'all', None, _('revert all changes when no arguments given')),
2963 ('r', 'rev', '', _('revision to revert to')), 2961 ('r', 'rev', '', _('revision to revert to')),
2964 ('', 'no-backup', None, _('do not save backup copies of files')), 2962 ('', 'no-backup', None, _('do not save backup copies of files')),
2965 ('n', 'dry-run', None, _('do not perform actions, just print output'))], 2963 ] + walkopts + dryrunopts,
2966 ] + walkopts,
2967 _('hg revert [-r REV] [NAME]...')), 2964 _('hg revert [-r REV] [NAME]...')),
2968 "rollback": (rollback, [], _('hg rollback')), 2965 "rollback": (rollback, [], _('hg rollback')),
2969 "root": (root, [], _('hg root')), 2966 "root": (root, [], _('hg root')),
2970 "^serve": 2967 "^serve":
2971 (serve, 2968 (serve,