Mercurial > hg
comparison mercurial/commands.py @ 5147:c80af96943aa
refactor options from cmdtable
- add extracommitopts for user and date
- factor stuff
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 08 Aug 2007 12:27:20 +0200 |
parents | 90be02035993 |
children | 06154aff2b1a |
comparison
equal
deleted
inserted
replaced
5146:7106f4899aa0 | 5147:c80af96943aa |
---|---|
2749 commitopts = [ | 2749 commitopts = [ |
2750 ('m', 'message', '', _('use <text> as commit message')), | 2750 ('m', 'message', '', _('use <text> as commit message')), |
2751 ('l', 'logfile', '', _('read commit message from <file>')), | 2751 ('l', 'logfile', '', _('read commit message from <file>')), |
2752 ] | 2752 ] |
2753 | 2753 |
2754 commitopts2 = [ | |
2755 ('d', 'date', '', _('record datecode as commit date')), | |
2756 ('u', 'user', '', _('record user as committer')), | |
2757 ] | |
2758 | |
2754 table = { | 2759 table = { |
2755 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), | 2760 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), |
2756 "addremove": | 2761 "addremove": |
2757 (addremove, | 2762 (addremove, |
2758 [('s', 'similarity', '', | 2763 [('s', 'similarity', '', |
2782 _('hg archive [OPTION]... DEST')), | 2787 _('hg archive [OPTION]... DEST')), |
2783 "backout": | 2788 "backout": |
2784 (backout, | 2789 (backout, |
2785 [('', 'merge', None, | 2790 [('', 'merge', None, |
2786 _('merge with old dirstate parent after backout')), | 2791 _('merge with old dirstate parent after backout')), |
2787 ('d', 'date', '', _('record datecode as commit date')), | |
2788 ('', 'parent', '', _('parent to choose when backing out merge')), | 2792 ('', 'parent', '', _('parent to choose when backing out merge')), |
2789 ('u', 'user', '', _('record user as committer')), | |
2790 ('r', 'rev', '', _('revision to backout')), | 2793 ('r', 'rev', '', _('revision to backout')), |
2791 ] + walkopts + commitopts, | 2794 ] + walkopts + commitopts + commitopts2, |
2792 _('hg backout [OPTION]... [-r] REV')), | 2795 _('hg backout [OPTION]... [-r] REV')), |
2793 "branch": | 2796 "branch": |
2794 (branch, | 2797 (branch, |
2795 [('f', 'force', None, | 2798 [('f', 'force', None, |
2796 _('set branch name even if it shadows an existing branch'))], | 2799 _('set branch name even if it shadows an existing branch'))], |
2828 _('hg clone [OPTION]... SOURCE [DEST]')), | 2831 _('hg clone [OPTION]... SOURCE [DEST]')), |
2829 "^commit|ci": | 2832 "^commit|ci": |
2830 (commit, | 2833 (commit, |
2831 [('A', 'addremove', None, | 2834 [('A', 'addremove', None, |
2832 _('mark new/missing files as added/removed before committing')), | 2835 _('mark new/missing files as added/removed before committing')), |
2833 ('d', 'date', '', _('record datecode as commit date')), | 2836 ] + walkopts + commitopts + commitopts2, |
2834 ('u', 'user', '', _('record user as commiter')), | |
2835 ] + walkopts + commitopts, | |
2836 _('hg commit [OPTION]... [FILE]...')), | 2837 _('hg commit [OPTION]... [FILE]...')), |
2837 "copy|cp": | 2838 "copy|cp": |
2838 (copy, | 2839 (copy, |
2839 [('A', 'after', None, _('record a copy that has already occurred')), | 2840 [('A', 'after', None, _('record a copy that has already occurred')), |
2840 ('f', 'force', None, | 2841 ('f', 'force', None, |
3020 ] + remoteopts, | 3021 ] + remoteopts, |
3021 _('hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')), | 3022 _('hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')), |
3022 "debugrawcommit|rawcommit": | 3023 "debugrawcommit|rawcommit": |
3023 (rawcommit, | 3024 (rawcommit, |
3024 [('p', 'parent', [], _('parent')), | 3025 [('p', 'parent', [], _('parent')), |
3025 ('d', 'date', '', _('date code')), | |
3026 ('u', 'user', '', _('user')), | |
3027 ('F', 'files', '', _('file list')) | 3026 ('F', 'files', '', _('file list')) |
3028 ] + commitopts, | 3027 ] + commitopts + commitopts2, |
3029 _('hg debugrawcommit [OPTION]... [FILE]...')), | 3028 _('hg debugrawcommit [OPTION]... [FILE]...')), |
3030 "recover": (recover, [], _('hg recover')), | 3029 "recover": (recover, [], _('hg recover')), |
3031 "^remove|rm": | 3030 "^remove|rm": |
3032 (remove, | 3031 (remove, |
3033 [('A', 'after', None, _('record remove that has already occurred')), | 3032 [('A', 'after', None, _('record remove that has already occurred')), |
3093 _('hg status [OPTION]... [FILE]...')), | 3092 _('hg status [OPTION]... [FILE]...')), |
3094 "tag": | 3093 "tag": |
3095 (tag, | 3094 (tag, |
3096 [('f', 'force', None, _('replace existing tag')), | 3095 [('f', 'force', None, _('replace existing tag')), |
3097 ('l', 'local', None, _('make the tag local')), | 3096 ('l', 'local', None, _('make the tag local')), |
3098 ('m', 'message', '', _('message for tag commit log entry')), | |
3099 ('d', 'date', '', _('record datecode as commit date')), | |
3100 ('u', 'user', '', _('record user as commiter')), | |
3101 ('r', 'rev', '', _('revision to tag')), | 3097 ('r', 'rev', '', _('revision to tag')), |
3102 ('', 'remove', None, _('remove a tag'))], | 3098 ('', 'remove', None, _('remove a tag')), |
3099 # -l/--local is already there, commitopts cannot be used | |
3100 ('m', 'message', '', _('use <text> as commit message')), | |
3101 ] + commitopts2, | |
3103 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), | 3102 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), |
3104 "tags": (tags, [], _('hg tags')), | 3103 "tags": (tags, [], _('hg tags')), |
3105 "tip": | 3104 "tip": |
3106 (tip, | 3105 (tip, |
3107 [('', 'style', '', _('display using template map file')), | 3106 [('', 'style', '', _('display using template map file')), |