mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
switch to 4 space indent
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.
Reformatted using:
files=( $(
git ls-tree -r --name-only HEAD | \
grep -Ev -e '^(third_party|recipes)/' | \
grep '\.py$';
git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"
The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py
These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py
Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
# 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.
|
||||
|
||||
"""
|
||||
Explicitly set/remove/print the merge-base for the current branch.
|
||||
|
||||
@@ -21,51 +20,52 @@ from git_common import get_or_create_merge_base, hash_one, upstream
|
||||
|
||||
|
||||
def main(argv):
|
||||
parser = argparse.ArgumentParser(
|
||||
description=__doc__.strip().splitlines()[0],
|
||||
epilog=' '.join(__doc__.strip().splitlines()[1:]))
|
||||
g = parser.add_mutually_exclusive_group()
|
||||
g.add_argument(
|
||||
'merge_base', nargs='?',
|
||||
help='The new hash to use as the merge base for the current branch'
|
||||
)
|
||||
g.add_argument('--delete', '-d', action='store_true',
|
||||
help='Remove the set mark.')
|
||||
opts = parser.parse_args(argv)
|
||||
parser = argparse.ArgumentParser(
|
||||
description=__doc__.strip().splitlines()[0],
|
||||
epilog=' '.join(__doc__.strip().splitlines()[1:]))
|
||||
g = parser.add_mutually_exclusive_group()
|
||||
g.add_argument(
|
||||
'merge_base',
|
||||
nargs='?',
|
||||
help='The new hash to use as the merge base for the current branch')
|
||||
g.add_argument('--delete',
|
||||
'-d',
|
||||
action='store_true',
|
||||
help='Remove the set mark.')
|
||||
opts = parser.parse_args(argv)
|
||||
|
||||
cur = current_branch()
|
||||
cur = current_branch()
|
||||
|
||||
if opts.delete:
|
||||
try:
|
||||
remove_merge_base(cur)
|
||||
except CalledProcessError:
|
||||
print('No merge base currently exists for %s.' % cur)
|
||||
return 0
|
||||
if opts.delete:
|
||||
try:
|
||||
remove_merge_base(cur)
|
||||
except CalledProcessError:
|
||||
print('No merge base currently exists for %s.' % cur)
|
||||
return 0
|
||||
|
||||
if opts.merge_base:
|
||||
try:
|
||||
opts.merge_base = hash_one(opts.merge_base)
|
||||
except CalledProcessError:
|
||||
print(
|
||||
'fatal: could not resolve %s as a commit' % opts.merge_base,
|
||||
file=sys.stderr)
|
||||
return 1
|
||||
if opts.merge_base:
|
||||
try:
|
||||
opts.merge_base = hash_one(opts.merge_base)
|
||||
except CalledProcessError:
|
||||
print('fatal: could not resolve %s as a commit' % opts.merge_base,
|
||||
file=sys.stderr)
|
||||
return 1
|
||||
|
||||
manual_merge_base(cur, opts.merge_base, upstream(cur))
|
||||
manual_merge_base(cur, opts.merge_base, upstream(cur))
|
||||
|
||||
ret = 0
|
||||
actual = get_or_create_merge_base(cur)
|
||||
if opts.merge_base and opts.merge_base != actual:
|
||||
ret = 1
|
||||
print("Invalid merge_base %s" % opts.merge_base)
|
||||
ret = 0
|
||||
actual = get_or_create_merge_base(cur)
|
||||
if opts.merge_base and opts.merge_base != actual:
|
||||
ret = 1
|
||||
print("Invalid merge_base %s" % opts.merge_base)
|
||||
|
||||
print("merge_base(%s): %s" % (cur, actual))
|
||||
return ret
|
||||
print("merge_base(%s): %s" % (cur, actual))
|
||||
return ret
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write('interrupted\n')
|
||||
sys.exit(1)
|
||||
try:
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write('interrupted\n')
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user