Bug 920231 - Factor out the command-line options for new bugs, r=edmorley
authorSteve Fink <sfink@mozilla.com>
Thu, 31 Oct 2013 14:43:02 -0700
changeset 126 df1942acf65c
parent 125 0cdc150b1562
child 127 0bda039dd274
push id59
push usersfink@mozilla.com
push date2013-10-31 21:43 +0000
reviewersedmorley
bugs920231
Bug 920231 - Factor out the command-line options for new bugs, r=edmorley
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -1076,16 +1076,31 @@ def newbug(ui, repo, *args, **opts):
                         title=values['BUGTITLE'],
                         description=values['BUGCOMMENT0'],
                         cc=cc,
                         **create_opts)
     result = json.load(urlopen(ui, req))
     bug = result['id']
     ui.write("Created bug %s at %s\n" % (bug, bugzilla + "show_bug.cgi?id=" + bug))
 
+newbug_opts = [
+    ('t', 'title', '',
+     'New bug title'),
+    ('', 'product', '',
+     'New bug product'),
+    ('C', 'component', '',
+     'New bug component'),
+    ('', 'prodversion', '',
+     'New bug product version'),
+    ('', 'cc', '',
+     'List of users to CC on the bug (comma-separated search strings)'),
+    ('P', 'ffprofile', '',
+     'Name of Firefox profile to pull bugzilla cookies from'),
+]
+
 cmdtable = {
     'bzexport':
         (bzexport,
          [('d', 'description', '', 'Bugzilla attachment description'),
           ('c', 'comment', '', 'Comment to add with the attachment'),
           ('e', 'edit', False,
            'Open a text editor to modify bug fields'),
           ('r', 'review', '',
@@ -1095,54 +1110,34 @@ cmdtable = {
           ('', 'cc', '',
            'List of users to CC on the bug (comma-separated search strings)'),
           ('', 'new', False,
            'Create a new bug'),
           ('i', 'interactive', False,
            'Interactive -- request confirmation before any permanent action'),
           ('', 'no-take-bug', False,
            'Do not assign bug to myself'),
-          ('', 'title', '',
-           'New bug title'),
-          ('', 'product', '',
-           'New bug product'),
-          ('C', 'component', '',
-           'New bug component'),
-          ('', 'prodversion', '',
-           'New bug product version'),
           ('', 'bug-description', '',
            'New bug description (aka comment 0)'),
-          ('', 'ffprofile', '',
-           'Name of Firefox profile to pull bugzilla cookies from'),
           ('u', 'update', None,
            'Update patch name and description to include bug number (only valid with --new)'),
           ('', 'no-update', None,
            'Suppress patch name/description update (override config file)'),
           ('', 'number', '',
            'When posting, prefix the patch description with "Patch <number> - "'),
           # The following option is passed through directly to patch.diffopts
-          ('w', 'ignore_all_space', False, 'Generate a diff that ignores whitespace changes')],
+          ('w', 'ignore_all_space', False,
+           'Generate a diff that ignores whitespace changes'),
+          ] + newbug_opts,
          _('hg bzexport [options] [REV] [BUG]')),
 
     'newbug':
         (newbug,
          [('c', 'comment', '', 'Comment to add with the bug'),
           ('e', 'edit', False,
            'Open a text editor to modify bug fields'),
           ('i', 'interactive', False,
            'Interactive -- request confirmation before any permanent action'),
           ('', 'take-bug', False,
            'Assign bug to myself'),
-          ('t', 'title', '',
-           'New bug title'),
-          ('', 'product', '',
-           'New bug product'),
-          ('C', 'component', '',
-           'New bug component'),
-          ('', 'prodversion', '',
-           'New bug product version'),
-          ('', 'cc', '',
-           'List of users to CC on the bug (comma-separated search strings)'),
-          ('P', 'ffprofile', '',
-           'Name of Firefox profile to pull bugzilla cookies from'),
-          ],
+          ] + newbug_opts,
          _('hg newbug [-e] [[-t] TITLE] [[-c] COMMENT]' )),
 }