Commit b3d52d34 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Revert "Use main as default branch for git recipe module"

This reverts commit 6b084326.

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 <sokcevic@google.com>
> Reviewed-by: Anthony Polito <apolito@google.com>

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 <sokcevic@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
parent da25c084
......@@ -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__'.
&mdash; **def [rebase](/recipes/recipe_modules/git/api.py#328)(self, name_prefix, branch, dir_path, remote_name=None, \*\*kwargs):**
......
......@@ -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
......
......@@ -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,
......
......@@ -193,7 +193,7 @@
"cmd": [
"git",
"rebase",
"origin/main"
"origin/master"
],
"cwd": "[START_DIR]/src",
"infra_step": true,
......
......@@ -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,
......
......@@ -192,7 +192,7 @@
"cmd": [
"git",
"rebase",
"origin/main"
"origin/master"
],
"cwd": "[START_DIR]/src",
"infra_step": true,
......
......@@ -193,7 +193,7 @@
"cmd": [
"git",
"rebase",
"origin/main"
"origin/master"
],
"cwd": "[START_DIR]/src",
"infra_step": true,
......
......@@ -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,
......
......@@ -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,
......
......@@ -16,7 +16,7 @@
"git",
"fetch",
"origin",
"main",
"master",
"--recurse-submodules",
"--progress"
],
......
......@@ -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,
......
......@@ -193,7 +193,7 @@
"cmd": [
"git",
"rebase",
"origin/main"
"origin/master"
],
"cwd": "[START_DIR]/src",
"infra_step": true,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment