Commit Graph

11 Commits (65aa0a04ff7fd6f1fa35e160f0d1bb8236570b92)

Author SHA1 Message Date
Gavin Mak edba22d4eb Fix multiline comment formatting
Many incorrectly formatted comments exist from the switch to
4 space indent: https://crrev.com/c/4836379

Bug: 1514505
Change-Id: I6366f9da812919bd35b999f18fa8a49b7a66c09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153633
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Mike Frysinger 124bb8e53c 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>
2 years ago
Marc-Antoine Ruel 0959bb1c2a Fix git-retry on errors
On macOS, it failed with:
  Exception in thread git-retry.tee.stderr:
  Traceback (most recent call last):
    File "/path/to/cipd's/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
      self.run()
    File "$HOME/depot_tools/git_retry.py", line 36, in run
      self.out_fd.write(line)

  TypeError: write() argument must be str, not bytes
Change-Id: Ib2a77731dee10b6bb2a2ea2a7ffeaf1165e15df6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3873929
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 4de5deacd4 Explicitly run everything with python3
R=aravindvasudev@google.com, gavinmak@google.com

Change-Id: Iaa5e960c6226dea3a0814c7cb778d952eafb1502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525960
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 9c0dc3026e Replace non-inclusive terms
Bug: 1118410, 1118413, 1118422, 1118424, 1118426
Bug: 1118428, 1118430, 1118434, 1118438, 1118442
Bug: 1118453, 1118454
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: build
Change-Id: I43e6305f8c3136774f01b57f12bb442bcb863371
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2551388
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
4 years ago
Edward Lesmes 98eda3f3e4 Revert "depot_tools: Run Python scripts using vpython (Part 1)"
This reverts commit d6186f9936.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> depot_tools: Run Python scripts using vpython (Part 1)
> 
> Tbr: iannucci@chromium.org
> Bug: 984182
> Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=iannucci@chromium.org,ehmaldonado@chromium.org

Change-Id: I7686985852608d0703bcbbab137df1ce82b29723
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749853
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur d6186f9936 depot_tools: Run Python scripts using vpython (Part 1)
Tbr: iannucci@chromium.org
Bug: 984182
Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Dan Jacques e2af38e019 [git retry] Fix Git wrapper fallthrough.
Currently, when the Infra Git wrapper is installed in PATH and a user
calls "git retry", the "git_retry.py" script is supposed to ignore the
request and fall through to the underlying command, relying on the Git
wrapper to handle retries.

However, Git apparently prepends its own executable path to PATH when it
is called, preventing the Git wrapper from being invoked the second time
and removing retries altogether.

We circumvent this by removing Git's new PATH influence when falling
through.

BUG=chromium:721450
TEST=local
  - Ran locally before and after patch, confirmed that after
  successfully retries throgh the wrapper.

R=agable@chromium.org, iannucci@chromium.org

Change-Id: Iae3d7a8bf805a5ba2bf827b06006a990d94e96d9
Reviewed-on: https://chromium-review.googlesource.com/506374
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Daniel Jacques <dnj@chromium.org>
8 years ago
Dan Jacques 2f8b0c1d8e git_retry: Disable retries under Git wrapper.
If the Infra Git wrapper is managing a Git execution, "git_retry" will
impose a second set of retries. Recognize this situation and disable
"git_retry" so that the Git wrapper is the sole managing process.

BUG=chromium:703868
TEST=local
  - Ran with and without environment variable, seems to work.

Change-Id: I4f749c9693a761abe2a062ed5f1dc09f51c69e30
Reviewed-on: https://chromium-review.googlesource.com/469229
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
8 years ago
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.

Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]

Review URL: https://codereview.chromium.org/955993006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
dnj@chromium.org de219ec51d Added 'git-retry' bootstrap
Added the 'git-retry' bootstrap command. This can be used to wrap other 'git'
commands around a fault-tolerant retry wrapper.

BUG=295109
TEST=localtest
R=iannucci@chromium.org, petermayo@chromium.org

Review URL: https://codereview.chromium.org/401673003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@285939 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago