代码拉取完成,页面将自动刷新
同步操作将从 dengly/depot_tools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Rename the current branch while maintaining correct dependencies."""
import argparse
import sys
import subprocess2
from git_common import current_branch, run, set_branch_config, branch_config
from git_common import branch_config_map
def main(args):
current = current_branch()
if current == 'HEAD':
current = None
old_name_help = 'The old branch to rename.'
if current:
old_name_help += ' (default %(default)r)'
parser = argparse.ArgumentParser()
parser.add_argument('old_name',
nargs=('?' if current else 1),
help=old_name_help,
default=current)
parser.add_argument('new_name', help='The new branch name.')
opts = parser.parse_args(args)
# when nargs=1, we get a list :(
if isinstance(opts.old_name, list):
opts.old_name = opts.old_name[0]
try:
run('branch', '-m', opts.old_name, opts.new_name)
# update the downstreams
for branch, merge in branch_config_map('merge').items():
if merge == 'refs/heads/' + opts.old_name:
# Only care about local branches
if branch_config(branch, 'remote') == '.':
set_branch_config(branch, 'merge',
'refs/heads/' + opts.new_name)
except subprocess2.CalledProcessError as cpe:
sys.stderr.write(cpe.stderr.decode('utf-8', 'replace'))
return 1
return 0
if __name__ == '__main__': # pragma: no cover
try:
sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt:
sys.stderr.write('interrupted\n')
sys.exit(1)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。