Bug 1400425 - Add a `mach try empty` command to push to try with no prompts r=ahal
☠☠ backed out by 72ec5bce838a ☠ ☠
authorWes Kocher <wkocher@mozilla.com>
Mon, 25 Sep 2017 15:17:50 -0700
changeset 670383 7fc37806848f3047db904293ffa4fe936cd1c8b0
parent 670382 c47c1d957c1968e040cbc2a5475f7f1fd1b5959f
child 670384 72ec5bce838a5ae9be00473c0937d2b275472500
push id81613
push userbmo:nchevobbe@mozilla.com
push dateTue, 26 Sep 2017 10:17:11 +0000
reviewersahal
bugs1400425
milestone58.0a1
Bug 1400425 - Add a `mach try empty` command to push to try with no prompts r=ahal MozReview-Commit-ID: 6F5vEpTTDS
tools/tryselect/mach_commands.py
tools/tryselect/selectors/empty.py
tools/tryselect/vcs.py
--- a/tools/tryselect/mach_commands.py
+++ b/tools/tryselect/mach_commands.py
@@ -138,16 +138,31 @@ class TrySelect(MachCommandBase):
         For example:
 
           ^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):
+        """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()
+
+    @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.
 
         Build options, platforms and regression tests may be selected
         using the usual try options (-b, -p and -u respectively). In
new file mode 100644
--- /dev/null
+++ b/tools/tryselect/selectors/empty.py
@@ -0,0 +1,15 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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
+
+import platform
+import subprocess
+
+from ..vcs import VCSHelper
+
+
+def run_empty_try():
+    vcs = VCSHelper.create()
+    return vcs.push_to_try("empty", "", [])
--- a/tools/tryselect/vcs.py
+++ b/tools/tryselect/vcs.py
@@ -98,17 +98,17 @@ class VCSHelper(object):
             sys.exit(1)
 
     def push_to_try(self, method, msg, labels=None, templates=None, push=True):
         commit_message = '%s\n\nPushed via `mach try %s`' % (msg, method)
 
         self.check_working_directory(push)
 
         config = None
-        if labels:
+        if labels or labels == []:
             config = self.write_task_config(labels, templates)
 
         try:
             if not push:
                 print("Commit message:")
                 print(commit_message)
                 if config:
                     print("Calculated try_task_config.json:")