changeset 32:daf7c333e01c

add bug to options
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Dec 2012 21:04:26 -0800
parents 864172062af7
children 915e064f2910
files mozillatry.py
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mozillatry.py	Mon Dec 10 12:56:12 2012 -0800
+++ b/mozillatry.py	Tue Dec 11 21:04:26 2012 -0800
@@ -102,11 +102,15 @@
 
 class MozillaTryConfiguration(configuration.Configuration):
 
+    # default configuration file
+    # TODO: upstream the pattern to configuration but with default_config_file = None
     default_config_file = os.path.join('~', '.mozutils')
     usage = '%prog [options] patch <patch2> <...>'
     load_help = 'load from config file'
     if os.path.exists(os.path.expanduser(default_config_file)):
         load_help += ' [DEFAULT: %s]' % default_config_file
+
+    # configuration options
     options = {'opt': {'default': True,
                        'help': "whether to try on opt builds"},
                'debug': {'default': True,
@@ -122,7 +126,10 @@
                               'flags': ['-t', '--talostests']},
                'mozilla_central': {'help': "path to mozilla-central clone",
                                    'required': True,
-                                   'flags': ["--m-c", "--mozilla-central"]}
+                                   'flags': ["--m-c", "--mozilla-central"]},
+               'bug': {'help': "bug number to post try results to",
+                       'type': int,
+                       'flags': ['-b', '--bug']}
                }
 
     # configuration items to interpolate as paths
@@ -180,7 +187,8 @@
     commit = try_syntax(opt=options.opt,
                         debug=options.debug,
                         unittests=options.unittests,
-                        talos=options.talostests
+                        talos=options.talostests,
+                        bug=options.bug
                         )
     print commit