Mercurial > hg
changeset 14306:db2a8eabe952
rebase: use cmdutil.command decorator
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Thu, 12 May 2011 17:09:56 +0200 |
parents | 32a548776b65 |
children | d5a65e3ee6b1 |
files | hgext/rebase.py |
diffstat | 1 files changed, 27 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/rebase.py Thu May 12 22:37:52 2011 +0200 +++ b/hgext/rebase.py Thu May 12 17:09:56 2011 +0200 @@ -24,6 +24,33 @@ nullmerge = -2 +cmdtable = {} +command = cmdutil.command(cmdtable) + +@command('rebase', + [('s', 'source', '', + _('rebase from the specified changeset'), _('REV')), + ('b', 'base', '', + _('rebase from the base of the specified changeset ' + '(up to greatest common ancestor of base and dest)'), + _('REV')), + ('d', 'dest', '', + _('rebase onto the specified changeset'), _('REV')), + ('', 'collapse', False, _('collapse the rebased changesets')), + ('m', 'message', '', + _('use text as collapse commit message'), _('TEXT')), + ('l', 'logfile', '', + _('read collapse commit message from file'), _('FILE')), + ('', 'keep', False, _('keep original changesets')), + ('', 'keepbranches', False, _('keep original branch names')), + ('', 'detach', False, _('force detaching of source from its original ' + 'branch')), + ('t', 'tool', '', _('specify merge tool')), + ('c', 'continue', False, _('continue an interrupted rebase')), + ('a', 'abort', False, _('abort an interrupted rebase'))] + + templateopts, + _('hg rebase [-s REV | -b REV] [-d REV] [options]\n' + 'hg rebase {-a|-c}')) def rebase(ui, repo, **opts): """move changeset (and descendants) to a different branch @@ -558,32 +585,3 @@ entry[1].append(('', 'rebase', None, _("rebase working directory to branch head")) ) - -cmdtable = { -"rebase": - (rebase, - [ - ('s', 'source', '', - _('rebase from the specified changeset'), _('REV')), - ('b', 'base', '', - _('rebase from the base of the specified changeset ' - '(up to greatest common ancestor of base and dest)'), - _('REV')), - ('d', 'dest', '', - _('rebase onto the specified changeset'), _('REV')), - ('', 'collapse', False, _('collapse the rebased changesets')), - ('m', 'message', '', - _('use text as collapse commit message'), _('TEXT')), - ('l', 'logfile', '', - _('read collapse commit message from file'), _('FILE')), - ('', 'keep', False, _('keep original changesets')), - ('', 'keepbranches', False, _('keep original branch names')), - ('', 'detach', False, _('force detaching of source from its original ' - 'branch')), - ('t', 'tool', '', _('specify merge tool')), - ('c', 'continue', False, _('continue an interrupted rebase')), - ('a', 'abort', False, _('abort an interrupted rebase'))] + - templateopts, - _('hg rebase [-s REV | -b REV] [-d REV] [options]\n' - 'hg rebase {-a|-c}')) -}