Bug 1210068 - Fix a problem saving mach try expressions with a space in the try syntax, r=chmanchester
authorJames Graham <james@hoppipolla.co.uk>
Tue, 29 Sep 2015 17:36:35 +0100
changeset 300784 14eb7f6689b3a4205197d4f72a7d68ecc5be5914
parent 300783 fd625bea9fde7f11d2132a8c560b84f823c4e6bb
child 300785 76af185df32b370568f209c4d375abcac96c1a79
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1210068
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1210068 - Fix a problem saving mach try expressions with a space in the try syntax, r=chmanchester
testing/mach_commands.py
testing/tools/autotry/autotry.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -472,17 +472,17 @@ class PushToTry(MachCommandBase):
         except ValueError as e:
             print("Error parsing -p argument:\n%s" % e.message)
             sys.exit(1)
 
         try:
             tests = (self.normalise_list(kwargs["tests"], allow_subitems=True)
                      if kwargs["tests"] else {})
         except ValueError as e:
-            print("Error parsing -u argument:\n%s" % e.message)
+            print("Error parsing -u argument (%s):\n%s" % (kwargs["tests"], e.message))
             sys.exit(1)
 
         try:
             talos = self.normalise_list(kwargs["talos"]) if kwargs["talos"] else []
         except ValueError as e:
             print("Error parsing -t argument:\n%s" % e.message)
             sys.exit(1)
 
--- a/testing/tools/autotry/autotry.py
+++ b/testing/tools/autotry/autotry.py
@@ -190,20 +190,23 @@ class AutoTry(object):
         if not success:
             return None
 
         try:
             data = config.get("try", name)
         except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
             return None
 
-        kwargs = vars(arg_parser().parse_args(data.split()))
+        kwargs = vars(arg_parser().parse_args(self.split_try_string(data)))
 
         return kwargs
 
+    def split_try_string(self, data):
+        return re.findall(r'(?:\[.*?\]|\S)+', data)
+
     def save_config(self, name, data):
         assert data.startswith("try: ")
         data = data[len("try: "):]
 
         parser = ConfigParser.RawConfigParser()
         parser.read([self.config_path])
 
         if not parser.has_section("try"):