[PATCH] rebase: use cmdutil.command decorator

Adrian Buehlmann adrian at cadifra.com
Thu May 12 10:36:24 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1305212996 -7200
# Node ID e6dfbd7b8cb84c276daddc4519e84644c8c77e6c
# Parent  b0f97b2589cc1f2c07c415c480c6ed02e347704a
rebase: use cmdutil.command decorator

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -24,6 +24,33 @@
 
 nullmerge = -2
 
+cmdtable = {}
+command = cmdutil.command(cmdtable)
+
+ at 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}'))
-}


More information about the Mercurial-devel mailing list