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

Drop support for master branch in roll_dep

R=gavinmak@google.com

Fixed: 1118447
Change-Id: I733c7f345a3a8e1dd4bf3a9935306ba43b1584c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3360904Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 35061445
......@@ -5,8 +5,8 @@
"""Rolls DEPS controlled dependency.
Works only with git checkout and git dependencies. Currently this
script will always roll to the tip of to origin/main or origin/master.
Works only with git checkout and git dependencies. Currently this script will
always roll to the tip of to origin/main.
"""
from __future__ import print_function
......@@ -72,22 +72,13 @@ def return_code(*args, **kwargs):
def is_pristine(root):
"""Returns True if a git checkout is pristine."""
# Check both origin/master and origin/main since many projects are
# transitioning to origin/main.
for branch in ('origin/main', 'origin/master'):
# `git rev-parse --verify` has a non-zero return code if the revision
# doesn't exist.
rev_cmd = ['git', 'rev-parse', '--verify', '--quiet',
'refs/remotes/' + branch]
if return_code(rev_cmd, cwd=root) != 0:
continue
diff_cmd = ['git', 'diff', '--ignore-submodules', branch]
return (not check_output(diff_cmd, cwd=root).strip() and
not check_output(diff_cmd + ['--cached'], cwd=root).strip())
raise Error('Couldn\'t find any of origin/main or origin/master')
# `git rev-parse --verify` has a non-zero return code if the revision
# doesn't exist.
diff_cmd = ['git', 'diff', '--ignore-submodules', 'origin/main']
return (not check_output(diff_cmd, cwd=root).strip() and
not check_output(diff_cmd + ['--cached'], cwd=root).strip())
def get_log_url(upstream_url, head, tot):
"""Returns an URL to read logs via a Web UI if applicable."""
......
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