From b3d52d34cdf1a70de9086a798871423af9dcdeea Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Thu, 1 Jul 2021 10:35:20 +0000 Subject: [PATCH] Revert "Use main as default branch for git recipe module" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6b08432689e2f3236dd7c30d3237f3c0da170095. Reason for revert: creates CLs that are on top of stale commits, not ToT Original change's description: > Use main as default branch for git recipe module > > R=​apolito@google.com, ehmaldonado@chromium.org > > Recipe-Nontrivial-Roll: build_limited_scripts_slave > Recipe-Nontrivial-Roll: chromiumos > Recipe-Nontrivial-Roll: infra > Change-Id: Ia0d39ae574852fa008a55e366c2320eb1845dc86 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2941678 > Commit-Queue: Josip Sokcevic > Reviewed-by: Anthony Polito Change-Id: I64ed8e7fbeab8cf8a0be6be4456fee400f770883 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2998588 Auto-Submit: Josip Sokcevic Commit-Queue: Rubber Stamper Bot-Commit: Rubber Stamper --- recipes/README.recipes.md | 2 +- recipes/recipe_modules/git/api.py | 10 +++++----- .../git/examples/full.expected/basic.json | 4 ++-- .../git/examples/full.expected/basic_branch.json | 2 +- .../git/examples/full.expected/basic_file_name.json | 4 ++-- .../git/examples/full.expected/basic_hash.json | 2 +- .../git/examples/full.expected/basic_ref.json | 2 +- .../full.expected/basic_submodule_update_force.json | 4 ++-- .../git/examples/full.expected/basic_tags.json | 4 ++-- .../git/examples/full.expected/can_fail_build.json | 2 +- .../git/examples/full.expected/cannot_fail_build.json | 4 ++-- .../git/examples/full.expected/cat-file_test.json | 2 +- .../examples/full.expected/count-objects_delta.json | 4 ++-- .../examples/full.expected/count-objects_failed.json | 4 ++-- .../full.expected/count-objects_with_bad_output.json | 4 ++-- .../count-objects_with_bad_output_fails_build.json | 2 +- .../git/examples/full.expected/curl_trace_file.json | 2 +- .../git/examples/full.expected/git-cache-checkout.json | 4 ++-- .../git/examples/full.expected/platform_win.json | 4 ++-- .../git/examples/full.expected/rebase_failed.json | 4 ++-- .../git/examples/full.expected/remote_not_origin.json | 4 ++-- .../git/examples/full.expected/set_got_revision.json | 4 ++-- 22 files changed, 39 insertions(+), 39 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index f6f586332..2a0b4af1e 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -557,7 +557,7 @@ upload. Args: * branch (str): new branch name, which must not yet exist. * name (str): step name. - * upstream (str): to origin/main. + * upstream (str): to origin/master. * kwargs: Forwarded to '__call__'. — **def [rebase](/recipes/recipe_modules/git/api.py#328)(self, name_prefix, branch, dir_path, remote_name=None, \*\*kwargs):** diff --git a/recipes/recipe_modules/git/api.py b/recipes/recipe_modules/git/api.py index 11ef37cda..e4390f713 100644 --- a/recipes/recipe_modules/git/api.py +++ b/recipes/recipe_modules/git/api.py @@ -211,16 +211,16 @@ class GitApi(recipe_api.RecipeApi): # There are five kinds of refs we can be handed: # 0) None. In this case, we default to api.buildbucket.gitiles_commit.ref. - # 1) A fully qualified branch name, e.g. 'refs/heads/main'. + # 1) A fully qualified branch name, e.g. 'refs/heads/master'. # Chop off 'refs/heads/' and now it matches case (4). # 2) A 40-character SHA1 hash. # 3) A fully-qualifed arbitrary ref, e.g. 'refs/foo/bar/baz'. - # 4) A branch name, e.g. 'main'. + # 4) A branch name, e.g. 'master'. # Note that 'FETCH_HEAD' can be many things (and therefore not a valid # checkout target) if many refs are fetched, but we only explicitly fetch # one ref here, so this is safe. if not ref: # Case 0. - ref = self.m.buildbucket.gitiles_commit.ref or 'main' + ref = self.m.buildbucket.gitiles_commit.ref or 'master' # If it's a fully-qualified branch name, trim the 'refs/heads/' prefix. if ref.startswith('refs/heads/'): # Case 1. @@ -338,7 +338,7 @@ class GitApi(recipe_api.RecipeApi): remote_name = remote_name or 'origin' with self.m.context(cwd=dir_path): try: - self('rebase', '%s/main' % remote_name, + self('rebase', '%s/master' % remote_name, name="%s rebase" % name_prefix, **kwargs) except self.m.step.StepFailure: self('rebase', '--abort', name='%s rebase abort' % name_prefix, @@ -396,7 +396,7 @@ class GitApi(recipe_api.RecipeApi): Args: * branch (str): new branch name, which must not yet exist. * name (str): step name. - * upstream (str): to origin/main. + * upstream (str): to origin/master. * kwargs: Forwarded to '__call__'. """ env = self.m.context.env diff --git a/recipes/recipe_modules/git/examples/full.expected/basic.json b/recipes/recipe_modules/git/examples/full.expected/basic.json index 04fbc8e81..176c6af75 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -193,7 +193,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_branch.json b/recipes/recipe_modules/git/examples/full.expected/basic_branch.json index 8c6ac6a8b..e6eb21f09 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic_branch.json @@ -193,7 +193,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json b/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json index ff4bcec05..1275a5673 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -195,7 +195,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_hash.json b/recipes/recipe_modules/git/examples/full.expected/basic_hash.json index 004f7b382..7f075a0e8 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic_hash.json @@ -192,7 +192,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_ref.json b/recipes/recipe_modules/git/examples/full.expected/basic_ref.json index 79b6d07eb..934fcebdf 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic_ref.json @@ -193,7 +193,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json b/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json index eaa8cddbe..b464689b2 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -194,7 +194,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_tags.json b/recipes/recipe_modules/git/examples/full.expected/basic_tags.json index 166522b3b..c82fc0f38 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic_tags.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress", "--tags" @@ -194,7 +194,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json b/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json index d1172b7f3..bbe7b50f9 100644 --- a/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +++ b/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], diff --git a/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json b/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json index cc4d1e8c2..c41a265ec 100644 --- a/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +++ b/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -196,7 +196,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json b/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json index 36f6ba836..f42835b5e 100644 --- a/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +++ b/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json @@ -193,7 +193,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json b/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json index 9bd97ec8b..8cef208cd 100644 --- a/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +++ b/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json @@ -37,7 +37,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -266,7 +266,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json b/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json index ca512d82f..7b036a1b1 100644 --- a/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +++ b/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -196,7 +196,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json b/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json index 4c3f7b916..2f0af9403 100644 --- a/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +++ b/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -198,7 +198,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json b/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json index 3042fcc1f..6b63b36bc 100644 --- a/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +++ b/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], diff --git a/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json b/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json index dff7f26d2..e60bd89cf 100644 --- a/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +++ b/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json @@ -194,7 +194,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json b/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json index 37de0c490..08c4aa43f 100644 --- a/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +++ b/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json @@ -64,7 +64,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -241,7 +241,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/platform_win.json b/recipes/recipe_modules/git/examples/full.expected/platform_win.json index d51e28885..140a12904 100644 --- a/recipes/recipe_modules/git/examples/full.expected/platform_win.json +++ b/recipes/recipe_modules/git/examples/full.expected/platform_win.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -193,7 +193,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]\\src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json b/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json index fabda356d..d6df9e270 100644 --- a/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +++ b/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -193,7 +193,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json b/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json index 755dd73b7..427935de0 100644 --- a/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +++ b/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json @@ -18,7 +18,7 @@ "git", "fetch", "not_origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -195,7 +195,7 @@ "cmd": [ "git", "rebase", - "not_origin/main" + "not_origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true, diff --git a/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json b/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json index 0515cdcb6..05b0fd46b 100644 --- a/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +++ b/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json @@ -16,7 +16,7 @@ "git", "fetch", "origin", - "main", + "master", "--recurse-submodules", "--progress" ], @@ -194,7 +194,7 @@ "cmd": [ "git", "rebase", - "origin/main" + "origin/master" ], "cwd": "[START_DIR]/src", "infra_step": true,