Bug 1530775 - [tryselect] Fix bug when migrating try syntax presets, r=kats,a=NPOTB
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 26 Feb 2019 14:33:03 -0500
changeset 519027 f2145aac6de2be3a8c85c28ec568623faa5902c6
parent 519026 d326a9d5f77bdbb3f43581b2ba3d268881698cdc
child 519080 8c60d3a2fcc499bac3e232d666ff4491143085e6
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, NPOTB
bugs1530775
milestone67.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 1530775 - [tryselect] Fix bug when migrating try syntax presets, r=kats,a=NPOTB Differential Revision: https://phabricator.services.mozilla.com/D21250
tools/tryselect/preset.py
--- a/tools/tryselect/preset.py
+++ b/tools/tryselect/preset.py
@@ -73,28 +73,29 @@ def migrate_old_presets():
     config.read(old_preset_path)
 
     unknown = defaultdict(list)
     for section in config.sections():
         for name, value in config.items(section):
             kwargs = {}
             if section == 'fuzzy':  # try fuzzy
                 kwargs['query'] = [value]
+                kwargs['selector'] = 'fuzzy'
 
             elif section == 'try':  # try syntax
-                section = 'syntax'
                 parser = SyntaxParser()
                 kwargs = vars(parser.parse_args(AutoTry.split_try_string(value)))
                 kwargs = {k: v for k, v in kwargs.items() if v != parser.get_default(k)}
+                kwargs['selector'] = 'syntax'
 
             else:
                 unknown[section].append("{} = {}".format(name, value))
                 continue
 
-            presets.save(name, selector=section, **kwargs)
+            presets.save(name, **kwargs)
 
     os.remove(old_preset_path)
 
     if unknown:
         for section, values in unknown.items():
             print("""
 warning: unknown section '{}', the following presets were not migrated:
   {}