Chromium Code Reviews| Index: recipe_modules/bot_update/api.py |
| diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py |
| index 8b3a35b0b8486556235c5a0834b87291d5329a39..4e03bc37fb54ac1f6ac5068385140eed6aadcc26 100644 |
| --- a/recipe_modules/bot_update/api.py |
| +++ b/recipe_modules/bot_update/api.py |
| @@ -20,7 +20,7 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| def __init__(self, mastername, buildername, slavename, issue, patchset, |
| patch_url, repository, gerrit_ref, rietveld, revision, |
| parent_got_revision, deps_revision_overrides, fail_patch, |
| - *args, **kwargs): |
| + lite, *args, **kwargs): |
| self._mastername = mastername |
| self._buildername = buildername |
| self._slavename = slavename |
| @@ -34,6 +34,7 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| self._parent_got_revision = parent_got_revision |
| self._deps_revision_overrides = deps_revision_overrides |
| self._fail_patch = fail_patch |
| + self._lite = lite |
| self._last_returned_properties = {} |
| super(BotUpdateApi, self).__init__(*args, **kwargs) |
| @@ -42,6 +43,9 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| """Wrapper for easy calling of bot_update.""" |
| assert isinstance(cmd, (list, tuple)) |
| bot_update_path = self.resource('bot_update.py') |
| + # TODO(hinoka): This should eventually be default. |
| + if self._lite: |
| + bot_update_path = self.resource('bot_update_lite.py') |
| kwargs.setdefault('infra_step', True) |
| kwargs.setdefault('env', {}) |
| kwargs['env'].setdefault('PATH', '%(PATH)s') |
| @@ -133,13 +137,17 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| self.m.properties.get('patch_project'), cfg) |
| rev_map = cfg.got_revision_mapping.as_jsonish() |
| + flags = [] |
| - flags = [ |
| + if not self._lite: |
|
hinoka
2016/05/05 20:36:48
This is ordered first on purpose, to avoid a no-op
|
| # 1. Do we want to run? (master/builder/slave). |
| - ['--master', master], |
| - ['--builder', builder], |
| - ['--slave', slave], |
| + flags.extend([ |
| + ['--master', master], |
| + ['--builder', builder], |
| + ['--slave', slave], |
| + ]) |
| + flags.extend([ |
| # 2. What do we want to check out (spec/root/rev/rev_map). |
| ['--spec', self.m.gclient.config_to_pythonish(cfg)], |
| ['--root', root], |
| @@ -157,7 +165,9 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| ['--apply_issue_key_file', key_file], |
| # 4. Hookups to JSON output back into recipes. |
| - ['--output_json', self.m.json.output()],] |
| + ['--output_json', self.m.json.output()],]) |
| + |
| + |
| # Collect all fixed revisions to simulate them in the json output. |
| @@ -196,7 +206,7 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| if clobber: |
| cmd.append('--clobber') |
| - if force: |
| + if force and not self._lite: |
| cmd.append('--force') |
| if no_shallow: |
| cmd.append('--no_shallow') |