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

--HG--
extra : rebase_source : 412cbc50c2901a97893779a73a7f70d5ee6e2d72
This commit is contained in:
Andrew Halberstadt 2017-10-11 15:45:08 -04:00
Родитель 65bf78b506
Коммит 7532e51ef9
2 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -38,9 +38,13 @@ def fuzzy_parser():
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
@ -144,8 +148,9 @@ class TrySelect(MachCommandBase):
@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
@ -155,7 +160,7 @@ class TrySelect(MachCommandBase):
menu.
"""
from tryselect.selectors.empty import run_empty_try
return run_empty_try()
return run_empty_try(**kwargs)
@SubCommand('try',
'syntax',

Просмотреть файл

@ -7,6 +7,7 @@ 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)