From ced744fa465542223771a7383edadba107e6c041 Mon Sep 17 00:00:00 2001 From: Michael Moss Date: Tue, 26 Sep 2017 12:11:33 -0700 Subject: [PATCH] Remove unused gclient.sync() 'with_branch_heads' arg. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This arg used to be used in a 'sync' call that was removed in crrev.com/7090f652d180eeff2663e3e3091d5db14123284c, but it was never applied to the remaining 'sync' call. This removes the arg and leaves "--with_branch_heads" (and adds "--with_tags") as default sync flags. Change-Id: Ice5a592d95a0b09dafddab24769f5edd8835a1c9 Recipe-Manual-Change: build_limited_scripts_slave Recipe-Manual-Change: build Reviewed-on: https://chromium-review.googlesource.com/677754 Reviewed-by: PaweÅ‚ Hajdan Jr. Commit-Queue: Michael Moss --- recipes/README.recipes.md | 16 ++++++++-------- recipes/recipe_modules/gclient/api.py | 13 ++++++------- .../gclient/examples/full.expected/basic.json | 6 ++++-- .../gclient/examples/full.expected/buildbot.json | 6 ++++-- .../gclient/examples/full.expected/revision.json | 6 ++++-- .../examples/full.expected/tryserver.json | 6 ++++-- recipes/recipe_modules/gclient/examples/full.py | 3 +-- 7 files changed, 31 insertions(+), 25 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index 263c7b535f..85f527575d 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -222,12 +222,12 @@ Returns (Path): The "depot_tools" root directory. Wrapper for easy calling of gclient steps. -— **def [break\_locks](/recipes/recipe_modules/gclient/api.py#287)(self):** +— **def [break\_locks](/recipes/recipe_modules/gclient/api.py#286)(self):** Remove all index.lock files. If a previous run of git crashed, bot was reset, etc... we might end up with leftover index.lock files. -— **def [calculate\_patch\_root](/recipes/recipe_modules/gclient/api.py#309)(self, patch_project, gclient_config=None):** +— **def [calculate\_patch\_root](/recipes/recipe_modules/gclient/api.py#308)(self, patch_project, gclient_config=None):** Returns path where a patch should be applied to based patch_project. @@ -244,7 +244,7 @@ Returns: If patch_project is not given or not recognized, it'll be just first solution root. -— **def [checkout](/recipes/recipe_modules/gclient/api.py#233)(self, gclient_config=None, revert=RevertOnTryserver, inject_parent_got_revision=True, with_branch_heads=False, \*\*kwargs):** +— **def [checkout](/recipes/recipe_modules/gclient/api.py#234)(self, gclient_config=None, revert=RevertOnTryserver, inject_parent_got_revision=True, \*\*kwargs):** Return a step generator function for gclient checkouts. @@ -260,7 +260,7 @@ Returns (dict): A mapping from property name -> project name. It merges the values of the deprecated got_revision_mapping and the new got_revision_reverse_mapping. -— **def [inject\_parent\_got\_revision](/recipes/recipe_modules/gclient/api.py#208)(self, gclient_config=None, override=False):** +— **def [inject\_parent\_got\_revision](/recipes/recipe_modules/gclient/api.py#209)(self, gclient_config=None, override=False):** Match gclient config to build revisions obtained from build_properties. @@ -270,7 +270,7 @@ Args: override (bool) - If True, will forcibly set revision and custom_vars even if the config already contains values for them. -  **@property**
— **def [is\_blink\_mode](/recipes/recipe_modules/gclient/api.py#274)(self):** +  **@property**
— **def [is\_blink\_mode](/recipes/recipe_modules/gclient/api.py#273)(self):** Indicates wether the caller is to use the Blink config rather than the Chromium config. This may happen for one of two reasons: @@ -281,9 +281,9 @@ Chromium config. This may happen for one of two reasons: — **def [resolve\_revision](/recipes/recipe_modules/gclient/api.py#147)(self, revision):** -— **def [runhooks](/recipes/recipe_modules/gclient/api.py#268)(self, args=None, name='runhooks', \*\*kwargs):** +— **def [runhooks](/recipes/recipe_modules/gclient/api.py#267)(self, args=None, name='runhooks', \*\*kwargs):** -— **def [set\_patch\_project\_revision](/recipes/recipe_modules/gclient/api.py#336)(self, patch_project, gclient_config=None):** +— **def [set\_patch\_project\_revision](/recipes/recipe_modules/gclient/api.py#335)(self, patch_project, gclient_config=None):** Updates config revision corresponding to patch_project. @@ -292,7 +292,7 @@ revision map. This doesn't overwrite the revision if it was already set.   **@spec_alias.deleter**
— **def [spec\_alias](/recipes/recipe_modules/gclient/api.py#115)(self):** -— **def [sync](/recipes/recipe_modules/gclient/api.py#152)(self, cfg, with_branch_heads=False, \*\*kwargs):** +— **def [sync](/recipes/recipe_modules/gclient/api.py#152)(self, cfg, \*\*kwargs):**   **@use_mirror.setter**
— **def [use\_mirror](/recipes/recipe_modules/gclient/api.py#102)(self, val):** ### *recipe_modules* / [gerrit](/recipes/recipe_modules/gerrit) diff --git a/recipes/recipe_modules/gclient/api.py b/recipes/recipe_modules/gclient/api.py index a8424da711..93108d9d4e 100644 --- a/recipes/recipe_modules/gclient/api.py +++ b/recipes/recipe_modules/gclient/api.py @@ -149,7 +149,7 @@ class GclientApi(recipe_api.RecipeApi): return revision.resolve(self.m.properties) return revision - def sync(self, cfg, with_branch_heads=False, **kwargs): + def sync(self, cfg, **kwargs): revisions = [] self.set_patch_project_revision(self.m.properties.get('patch_project'), cfg) for i, s in enumerate(cfg.solutions): @@ -185,8 +185,9 @@ class GclientApi(recipe_api.RecipeApi): # dir for git-based builds (e.g. maybe some combination of 'git # reset/clean -fx' and removing the 'out' directory). j = '-j2' if self.m.platform.is_win else '-j8' - args = ['sync', '--verbose', '--with_branch_heads', '--nohooks', j, - '--reset', '--force', '--upstream', '--no-nag-max'] + args = ['sync', '--verbose', '--nohooks', j, '--reset', '--force', + '--upstream', '--no-nag-max', '--with_branch_heads', + '--with_tags'] if cfg.delete_unversioned_trees: args.append('--delete_unversioned_trees') self('sync', args + revisions + @@ -231,8 +232,7 @@ class GclientApi(recipe_api.RecipeApi): cfg.solutions[0].custom_vars[custom_var] = val def checkout(self, gclient_config=None, revert=RevertOnTryserver, - inject_parent_got_revision=True, with_branch_heads=False, - **kwargs): + inject_parent_got_revision=True, **kwargs): """Return a step generator function for gclient checkouts.""" cfg = gclient_config or self.c assert cfg.complete() @@ -247,8 +247,7 @@ class GclientApi(recipe_api.RecipeApi): sync_step = None try: - sync_step = self.sync(cfg, with_branch_heads=with_branch_heads, - **kwargs) + sync_step = self.sync(cfg, **kwargs) cfg_cmds = [ ('user.name', 'local_bot'), diff --git a/recipes/recipe_modules/gclient/examples/full.expected/basic.json b/recipes/recipe_modules/gclient/examples/full.expected/basic.json index 361517dc47..17843b505b 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/basic.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/basic.json @@ -21,13 +21,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--output-json", "/path/to/tmp/json" @@ -105,13 +106,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--revision", "src/third_party/angle@refs/heads/lkgr", diff --git a/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json b/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json index a850259900..359d7cef49 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json @@ -21,13 +21,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--output-json", "/path/to/tmp/json" @@ -105,13 +106,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--revision", "src/third_party/angle@refs/heads/lkgr", diff --git a/recipes/recipe_modules/gclient/examples/full.expected/revision.json b/recipes/recipe_modules/gclient/examples/full.expected/revision.json index 910daa62fe..6bc53d9036 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/revision.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/revision.json @@ -21,13 +21,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--revision", "src@abc", @@ -107,13 +108,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--revision", "Angle@abc", diff --git a/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json b/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json index 36e6a0d122..45b8b2394b 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json @@ -21,13 +21,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--revision", "src@HEAD", @@ -107,13 +108,14 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "sync", "--verbose", - "--with_branch_heads", "--nohooks", "-j8", "--reset", "--force", "--upstream", "--no-nag-max", + "--with_branch_heads", + "--with_tags", "--delete_unversioned_trees", "--revision", "Angle@HEAD", diff --git a/recipes/recipe_modules/gclient/examples/full.py b/recipes/recipe_modules/gclient/examples/full.py index 54ed526045..6d5e9b8909 100644 --- a/recipes/recipe_modules/gclient/examples/full.py +++ b/recipes/recipe_modules/gclient/examples/full.py @@ -65,8 +65,7 @@ def RunSteps(api): bl_cfg.got_revision_mapping['src/blatley'] = 'got_blatley_revision' with api.context(cwd=api.path['start_dir'].join('src', 'third_party')): api.gclient.checkout( - gclient_config=bl_cfg, - with_branch_heads=True) + gclient_config=bl_cfg) api.gclient.got_revision_reverse_mapping(bl_cfg)