Update roll_deps.py to use main branch

No-Presubmit: True
No-Tree-Checks: True
Bug: webrtc:12895
Change-Id: I381b3bd2321ba50ecc7b9fddf136f18e5fe58686
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223069
Commit-Queue: Christoffer Jansson <jansson@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34376}
This commit is contained in:
Christoffer Jansson 2021-06-22 14:23:06 +02:00 committed by WebRTC LUCI CQ
parent e99f6879f6
commit df400c383d

View File

@ -568,16 +568,16 @@ def _IsTreeClean():
return False return False
def _EnsureUpdatedMasterBranch(dry_run): def _EnsureUpdatedMainBranch(dry_run):
current_branch = _RunCommand(['git', 'rev-parse', '--abbrev-ref', current_branch = _RunCommand(['git', 'rev-parse', '--abbrev-ref',
'HEAD'])[0].splitlines()[0] 'HEAD'])[0].splitlines()[0]
if current_branch != 'master': if current_branch != 'main':
logging.error( logging.error(
'Please checkout the master branch and re-run this script.') 'Please checkout the main branch and re-run this script.')
if not dry_run: if not dry_run:
sys.exit(-1) sys.exit(-1)
logging.info('Updating master branch...') logging.info('Updating main branch...')
_RunCommand(['git', 'pull']) _RunCommand(['git', 'pull'])
@ -590,7 +590,7 @@ def _CreateRollBranch(dry_run):
def _RemovePreviousRollBranch(dry_run): def _RemovePreviousRollBranch(dry_run):
active_branch, branches = _GetBranches() active_branch, branches = _GetBranches()
if active_branch == ROLL_BRANCH_NAME: if active_branch == ROLL_BRANCH_NAME:
active_branch = 'master' active_branch = 'main'
if ROLL_BRANCH_NAME in branches: if ROLL_BRANCH_NAME in branches:
logging.info('Removing previous roll branch (%s)', ROLL_BRANCH_NAME) logging.info('Removing previous roll branch (%s)', ROLL_BRANCH_NAME)
if not dry_run: if not dry_run:
@ -672,7 +672,7 @@ def main():
'--ignore-unclean-workdir', '--ignore-unclean-workdir',
action='store_true', action='store_true',
default=False, default=False,
help=('Ignore if the current branch is not master or if there ' help=('Ignore if the current branch is not main or if there '
'are uncommitted changes (default: %(default)s).')) 'are uncommitted changes (default: %(default)s).'))
grp = p.add_mutually_exclusive_group() grp = p.add_mutually_exclusive_group()
grp.add_argument( grp.add_argument(
@ -705,7 +705,7 @@ def main():
_RemovePreviousRollBranch(opts.dry_run) _RemovePreviousRollBranch(opts.dry_run)
if not opts.ignore_unclean_workdir: if not opts.ignore_unclean_workdir:
_EnsureUpdatedMasterBranch(opts.dry_run) _EnsureUpdatedMainBranch(opts.dry_run)
deps_filename = os.path.join(CHECKOUT_SRC_DIR, 'DEPS') deps_filename = os.path.join(CHECKOUT_SRC_DIR, 'DEPS')
webrtc_deps = ParseLocalDepsFile(deps_filename) webrtc_deps = ParseLocalDepsFile(deps_filename)