Remove default value from optional arguments, since they are always passed.
In particular, the default value for `out` was a text stream (sys.stdout),
but the value passed to `out` is always a binary stream, which is confusing.
Get rid of the `err` argument, since it is always sys.stderr, and only used
for testing.
Change-Id: Ia289e9a97b968a0c802fc2f419397c1e494f713c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1986064
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit cd1331ea69.
Reason for revert:
Original CL was reverted.
Original change's description:
> Move httplib2 import above third_party.
>
> 7fd6347be3 removed the third_party/httplib2 files, but left the pyc files. This is breaking CQ for nest.
>
> move httplib2 import above adding third_party to the path in ninjalog_uploader_wrapper to fix.
>
> Change-Id: Id28f68ce7e3eb94783bdd5ee7ce15ae5930fde7e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1988690
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Mark Orchard <morchard@google.com>
TBR=ehmaldonado@webrtc.org,ehmaldonado@chromium.org,morchard@google.com,apolito@google.com
Change-Id: Ic7775cdb4abae1855358711335349fc39eb37dfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1988739
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This matches the recent change Chromium's Python style guide.
This also changes the .style.yapf in depot_tools to be explicit
about the style used in this repo.
Bug: 846432
Change-Id: I4947a90aec1739a9a86ffc9bfc5eacc1182dc186
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1987006
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
7fd6347be3 removed the third_party/httplib2 files, but left the pyc files. This is breaking CQ for nest.
move httplib2 import above adding third_party to the path in ninjalog_uploader_wrapper to fix.
Change-Id: Id28f68ce7e3eb94783bdd5ee7ce15ae5930fde7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1988690
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Mark Orchard <morchard@google.com>
This reverts commit 7fd6347be3.
Reason for revert: This broke Flutter CI - we're not using vpython everywhere yet
Original change's description:
> depot_tools: Remove third_party/httplib2.
>
> depot_tools' scripts have been using vpython httplib2 for a while.
>
> Change-Id: I9403d92332c74de0ed69d6f59f60c81772d0577a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1978983
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com
Change-Id: Ie53a8d07ccfba5a7cc5bcb431d4f7b897f66788a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1989012
Reviewed-by: Dan Field <dnfield@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
In repos that are checked out separately from chromium, invoking
"git cl format" on a change that has files that would be formatted using
clang-format causes an error because the depot_tools version of
clang-format looks for a clang-format inside the repo.
This prevents using proto-based properties (the preferred mechanism
going forward) in recipe repos that enforce formatting. The
--no-clang-format flag provides a workaround that can be used to
prevent trying to format any files where clang-format doesn't work.
Bug: 979330
Change-Id: Ice8561d88b29623deb953465253f92c88aa7fc2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1986111
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
The current behavior of the --no-python flag doesn't disable formatting
for python files. Instead, it has the same effect as the --python flag.
Change-Id: I26024d3030b9c873180b488d00351676c37c9492
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1985785
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
depot_tools' scripts have been using vpython httplib2 for a while.
Change-Id: I9403d92332c74de0ed69d6f59f60c81772d0577a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1978983
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
In python3, dict.keys() returns a view instead of a separate
dictionary, which results in the following error while trying
to use cpplint:
"RuntimeError: dictionary changed size during iteration"
Use a list of the keyset instead.
R=ehmaldonado@chromium.org
Bug: 1027160
Change-Id: I0040b8912d7e446d35d755bb021670c9f2248f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1966743
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Sarthak Kukreti <sarthakkukreti@chromium.org>
goma_ctl.py recommends that folks run `pip install pywin32`, which will
work up until python in depot_tools is updated, at which point it will
break again.
Running with vpython means that the vpython spec which ships with goma
will correctly take effect.
R=brucedawson@chromium.org, tikuta@chromium.org
Bug: 1033106
Change-Id: Icafadf381df782ab30d6cc156419dd7ed424d2bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1962721
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
For bonus points, this also fixes PRESUBMIT so that it actually checks
the manifests.
TBR=bpastene@chromium.org, tandrii@chromium.org
Bug: 1032743
Change-Id: I4dac5a520e333e3c429597684a44ece83d21c5fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1960950
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Now that the CQ has been enabled for both the Beta and Stable
branches, git-drover should use the commit queue instead of
directly submitting the CL. To that end, this CL replaces the
usage of `git cl land` with `git cl set-commit`.
Change-Id: I0d0c10115acc98eafe0c069825de5499b8ade3e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1960697
Auto-Submit: Aaron Gable <agable@chromium.org>
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Garrett Beaty <gbeaty@chromium.org>
We load it, but disable all the warnings by default. People can
re-enable the warnings for their modules if they want, but there
is way too much broken code in the tree currently.
Bug: 738534
Test: ran each pylint version by hand on some bad code
Change-Id: Ia5b24093f18febd452f4c1eed6e82044544161bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1958849
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
The intention is to create parity with cipd module[1] in recipe engine so that
there will be less friction when downstream repo starts to consume cipd module in
recipe engine
[1]: https://chromium.googlesource.com/infra/luci/recipes-py/+/refs/heads/master/recipe_modules/cipd/test_api.py#23
R=iannucci
Bug: 875523
Change-Id: I5f9100a81e7ca3c7300ab3b0ba198120d598ca48
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: release_scripts
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1951224
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This reverts commit 32a801b5da.
Reason for revert:
It's causing depot tools presubmit to time out
(Also, introduces a Python 3 error for git_cache).
Original change's description:
> [bot_update] Also bootstrap in the case that there are 0 pack files
>
> This can happen if the cache repo was init'd, but has no pack files;
> previously it would try to fetch from scratch.
>
> R=ehmaldonado@chromium.org, tandrii@chromium.org
>
> No-Presubmit: true
> Change-Id: I97e863dd6c2ecfd00fdb4238dda48e0d3929c4f2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1941337
> Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
TBR=iannucci@chromium.org,tandrii@google.com,ehmaldonado@chromium.org
Change-Id: I93366bcc6ff1df579a67d51c2cda812c84a06215
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1951985
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This can happen if the cache repo was init'd, but has no pack files;
previously it would try to fetch from scratch.
R=ehmaldonado@chromium.org, tandrii@chromium.org
No-Presubmit: true
Change-Id: I97e863dd6c2ecfd00fdb4238dda48e0d3929c4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1941337
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
The presubmit step does not require tags so avoid them, as fetching
tags implicitly adds a lot of time to the fetch step for repos like
chromium with many many tags.
R=iannucci@chromium.org
Recipe-Nontrivial-Roll: build
Bug: 1019824
Change-Id: I741970b8c61bd88bafde6ef30b733e9bfc2c0a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1951510
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Adds error handling logic for pre-existing tags (which can occur
if "archive" is CTRL-C aborted midway through) and for undeletable
branches (which can happen if they are currently checked out in a
working dir).
Change-Id: I27b6da9f5860c307f49cbeabb1b0ccf9cfb28eb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1930023
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Kevin Marshall <kmarshall@chromium.org>