# HG changeset patch # User Adrian Buehlmann # Date 1305212996 -7200 # Node ID db2a8eabe952d9e10e7fdda3707ebc2632960dfd # Parent 32a548776b6559d586364027d79b3bee08a1babc rebase: use cmdutil.command decorator diff -r 32a548776b65 -r db2a8eabe952 hgext/rebase.py --- 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}')) -}