Bug 1406777 - Support --message and --no-push with |mach try empty|, r=armenzg
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 11 Oct 2017 15:45:08 -0400
changeset 385947 6e3a0b791182798107d4311d4e137df6c55c6b37
parent 385946 c1f9baaa7b63ce9fde52044adf8bef2d9e42cb86
child 385948 77cfd15e655674afc0553928c1b40cbd4e4ddbbc
push id32672
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:00:05 +0000
treeherdermozilla-central@3efcb26e5f37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarmenzg
bugs1406777
milestone58.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 1406777 - Support --message and --no-push with |mach try empty|, r=armenzg This adds all the common arguments to |mach try empty|, including preset arguments which will just be ignored if specified. The commit message can be changed with: ./mach try empty -m DONTBUILD MozReview-Commit-ID: 5RYfLBOIX1g
tools/tryselect/mach_commands.py
tools/tryselect/selectors/empty.py
--- a/tools/tryselect/mach_commands.py
+++ b/tools/tryselect/mach_commands.py
@@ -33,19 +33,23 @@ def syntax_parser():
     return parser
 
 
 def fuzzy_parser():
     from tryselect.selectors.fuzzy import FuzzyParser
     return FuzzyParser()
 
 
-def generic_parser():
+def base_parser():
     from tryselect.cli import BaseTryParser
-    parser = BaseTryParser()
+    return BaseTryParser()
+
+
+def generic_parser():
+    parser = base_parser()
     parser.add_argument('argv', nargs=argparse.REMAINDER)
     return parser
 
 
 @SettingsProvider
 class TryConfig(object):
 
     @classmethod
@@ -139,28 +143,29 @@ class TrySelect(MachCommandBase):
 
           ^start 'exact | !ignore fuzzy end$
         """
         from tryselect.selectors.fuzzy import run_fuzzy_try
         return run_fuzzy_try(**kwargs)
 
     @SubCommand('try',
                 'empty',
-                description='Push to try without scheduling any tasks.')
-    def try_empty(self):
+                description='Push to try without scheduling any tasks.',
+                parser=base_parser)
+    def try_empty(self, **kwargs):
         """Push to try, running no builds or tests
 
         This selector does not prompt you to run anything, it just pushes
         your patches to try, running no builds or tests by default. After
         the push finishes, you can manually add desired jobs to your push
         via Treeherder's Add New Jobs feature, located in the per-push
         menu.
         """
         from tryselect.selectors.empty import run_empty_try
-        return run_empty_try()
+        return run_empty_try(**kwargs)
 
     @SubCommand('try',
                 'syntax',
                 description='Select tasks on try using try syntax',
                 parser=syntax_parser)
     def try_syntax(self, **kwargs):
         """Push the current tree to try, with the specified syntax.
 
--- a/tools/tryselect/selectors/empty.py
+++ b/tools/tryselect/selectors/empty.py
@@ -2,11 +2,12 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from ..vcs import VCSHelper
 
 
-def run_empty_try():
+def run_empty_try(message='{msg}', push=True, **kwargs):
     vcs = VCSHelper.create()
-    return vcs.push_to_try("empty", "", [])
+    msg = 'No try selector specified, use "Add New Jobs" to select tasks.'
+    return vcs.push_to_try('empty', message.format(msg=msg), [], push=push)