206a755a4f30 — Steve Fink 4 years ago
Add in severity
2 files changed, 8 insertions(+), 1 deletions(-)

M __init__.py
M bz.py
M __init__.py +6 -0
@@ 137,6 137,8 @@ newbug_opts = [
      b'New bug type (enhancement/defect/task)'),
     (b'P', b'priority', b'',
      b'Priority'),
+    (b'S', b'severity', b'',
+     b'Severity'),
     (b'', b'prodversion', b'',
      b'New bug product version'),
     (b'', b'cc', b'',

          
@@ 442,6 444,7 @@ Component: @COMPONENT@
 Version: @PRODVERSION@
 Type: @TYPE@
 Priority: @PRIORITY@
+Severity: @SEVERITY@
 CC: @CC@
 Depends: @DEPENDS@
 Blocks: @BLOCKS@

          
@@ 468,6 471,7 @@ Component: @COMPONENT@
 Version: @PRODVERSION@
 Type: @TYPE@
 Priority: @PRIORITY@
+Severity: @SEVERITY@
 CC: @CC@
 Depends: @DEPENDS@
 Blocks: @BLOCKS@

          
@@ 1184,6 1188,7 @@ def create_bug(ui, values, bzinfo, opts)
                                    blocks=values['BLOCKS'],
                                    bug_type=values['TYPE'],
                                    priority=values['PRIORITY'],
+                                   severity=values['SEVERITY'],
                                    **create_opts)
     except Exception as e:
         raise error.Abort(_("error creating bug: %s" % str(e)))

          
@@ 1603,6 1608,7 @@ def fill_values_from_opts(ui, bzinfo, in
         values['COMPONENT'] = opts.get('component', '') or ui.config(b'bzexport', b'component', '<choose-from-menu>')
         values['TYPE'] = opts.get('bugtype') or 'defect'
         values['PRIORITY'] = opts.get('priority') or 'P3'
+        values['SEVERITY'] = opts.get('severity') or '--'
         values['PRODVERSION'] = opts.get('prodversion', '') or ui.config(b'bzexport', b'prodversion', '<default>')
         values['BLOCKS'] = opts["blocks"].split(",")
         values['DEPENDS'] = opts["depends"].split(",")

          
M bz.py +2 -1
@@ 37,7 37,7 @@ def make_url(api_server, auth, command, 
 
 def create_bug(token, product, component, version, title, description,
                assign_to=None, cc=[], depends=[], blocks=[],
-               bug_type='defect', priority='P3'):
+               bug_type='defect', priority='P3', severity='--'):
     """
     Create a bugzilla bug.
     """

          
@@ 54,6 54,7 @@ def create_bug(token, product, component
         'cc': cc,
         'type': bug_type,
         'priority': priority,
+        'severity': severity,
     }
 
     if assign_to: