Bug 1210068 - Fix a problem saving mach try expressions with a space in the try syntax, r=chmanchester

This commit is contained in:
James Graham 2015-09-29 17:36:35 +01:00
parent 0a9af65e7d
commit b25fef4433
2 changed files with 5 additions and 2 deletions

View File

@ -477,7 +477,7 @@ class PushToTry(MachCommandBase):
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:

View File

@ -195,10 +195,13 @@ class AutoTry(object):
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: "):]