Commit 69902d09 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Support main branch as default branch in roll-dep

R=ehmaldonado@google.com

Bug: 1172028
Change-Id: Ica77db151eeb48c65f62043cbe30828dfa17bf95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2659510Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 3d3f7cfa
......@@ -169,10 +169,14 @@ def calculate_roll(full_dir, dependency, roll_to):
if not head:
raise Error('%s is unpinned.' % dependency)
check_call(['git', 'fetch', 'origin', '--quiet'], cwd=full_dir)
if roll_to == 'origin/HEAD':
check_output(['git', 'remote', 'set-head', 'origin', '-a'], cwd=full_dir)
roll_to = check_output(['git', 'rev-parse', roll_to], cwd=full_dir).strip()
return head, roll_to
def gen_commit_msg(logs, cmdline, reviewers, bug):
"""Returns the final commit message."""
commit_msg = ''
......@@ -218,7 +222,7 @@ def main():
'--log-limit', type=int, default=100,
help='Trim log after N commits (default: %(default)s)')
parser.add_argument(
'--roll-to', default='origin/master',
'--roll-to', default='origin/HEAD',
help='Specify the new commit to roll to (default: %(default)s)')
parser.add_argument(
'--key', action='append', default=[],
......@@ -227,7 +231,7 @@ def main():
args = parser.parse_args()
if len(args.dep_path) > 1:
if args.roll_to != 'origin/master':
if args.roll_to != 'origin/HEAD':
parser.error(
'Can\'t use multiple paths to roll simultaneously and --roll-to')
if args.key:
......
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