Also, rename --all-files to --all_files to be consistent with other
options, and remove reviewers, since it's never set in presubmit_support.
Bug: 1042324
Change-Id: I34fa3162c56e39bcdd52ad1e19058357de934f1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2067351
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
The build summary script was overly aggressive about summarizing .mojom
files under the mojo category. This was intended to measure the cost of
generating source from mojo files but it accidentally pulled in the
.mojom object files.
Categorizing different types of object files might be worthwhile but
that should be done intentionally and consistently.
Change-Id: Iab6b7e94797ce7f1ed46805034b4f274c88617e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2067647
Commit-Queue: Aaron Gable <agable@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
This fixes an issue on Windows where running `gclient setdep` would convert the DEPS file from LF to CRLF line endings.
From the python 2.7 docs:
" On Windows, 'b' appended to the mode opens the file in binary mode, so there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a distinction between text and binary files; the end-of-line characters in text files are automatically altered slightly when data is read or written. "
- https://docs.python.org/2.7/tutorial/inputoutput.html#reading-and-writing-files
Change-Id: I94183918789a8cdd4aa655db4b3dadfaae23d13a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2067477
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: John Emau <John.Emau@microsoft.com>
Mock GetChangeDetail instead of using self.calls to make the code
easier to change.
Bug: 1051631
Change-Id: I77361caccaf694644839825d890343864267688f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2062716
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Various collections module members were removed in Python 3.9 after being deprecated and moved to collections.abc in earlier Python 3 versions.
For accessing these members alias collections_abc as:
* collections.abc on Python 3
* collections on Python 2
Traceback (most recent call last):
File "C:\Google\depot_tools\gclient.py", line 107, in <module>
import gclient_eval
File "C:\Google\depot_tools\gclient_eval.py", line 11, in <module>
import gclient_utils
File "C:\Google\depot_tools\gclient_utils.py", line 1201, in <module>
class FrozenDict(collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'
Traceback (most recent call last):
File "C:\Google\depot_tools\gclient.py", line 107, in <module>
import gclient_eval
File "C:\Google\depot_tools\gclient_eval.py", line 25, in <module>
class _NodeDict(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
Bug: 984182
Change-Id: I7a4417978b93e29397e63764e4570a598c075bc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2043879
Auto-Submit: Raul Tambre <raul@tambre.ee>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
scm.GIT functions are tested, and using them makes it easier to mock
git calls on git-cl tests.
Bug: 1051631
Change-Id: If067aa3f71b7478cafd7985d3020dacc0c6a41c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2055464
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 9ee86e5a46.
Reason for revert: Typo.
Original change's description:
> gerrit-util: Fix GCE check from behind proxy.
>
> Setting HTTP_PROXY or HTTPS_PROXY environment variables will cause git cl
> to fail.
>
> The behavior of an unreachable server behind proxy is different from a direct
> connection, it won't throw a httplib2.ServerNotFoundError error,
> so catch httplib2.Httplib2Error instead.
>
> Bug: 1050380
> Change-Id: I32e2220483de1fd6222c7fd6063039fb86277ef0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2050947
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Idb17520e71fc1d892694e0d4d1cf1630a42bb482
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1050380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2055390
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Setting HTTP_PROXY or HTTPS_PROXY environment variables will cause git cl
to fail.
The behavior of an unreachable server behind proxy is different from a direct
connection, it won't throw a httplib2.ServerNotFoundError error,
so catch httplib2.Httplib2Error instead.
Bug: 1050380
Change-Id: I32e2220483de1fd6222c7fd6063039fb86277ef0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2050947
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
scm:
- Add methods to deal with git configs and tests for them.
Will make it easier to mock git config calls as opposed
to all git calls.
- Add tests to FetchUpstreamTuple
git-cl:
- Mock out settings.GetChangeRoot()
- Use scm.GIT.FetchUpstreamTuple() to reduce code duplication,
and mock it out on tests.
Bug: 1051631
Change-Id: I1a3220b4c0f3e6221b3c00550259a433c2775798
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2052552
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
We start warning if people have outdated systems.
Bug: 997354
Test: `cros --help` uses python3 now
Change-Id: I1491f1c0eea4d544cc508b461153c54c8072699d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2052243
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This pulls the latest version from upstream.
This drops the custom keys Chromium has been carrying.
We switched our release signing over to the official key,
so there's no need for ours anymore.
The new version will attempt to use Python 3 if available
and whine if it's not. It shouldn't cause errors, just new
warnings, but it should help us track down old systems.
Bug: https://crbug.com/gerrit/10418
Test: `repo sync` still works
Change-Id: I915d0874a1642880831964f91c4632f9d17a1e4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2044341
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Is not needed, and it's deprecated on Python 3.
Change-Id: I040891ff74708c6606b8c216da3a0bb98d44d977
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2042281
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
The `author` parameter is never set.
The `local_description` parameter was only set with the
purpose of getting the local description, so separate it into its
own method and call that instead.
Use the absolute root when getting the list of modified files instead.
Bug: 1042324
Change-Id: I8505172edaacee0656dda98ebbd5f8ebfacb3cef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2038050
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of 1c8026d2f1
Original change's description:
> presubmit_support: Add --all-files options.
>
> Will be set when --all is passed to git-cl presubmit to execute
> presubmit checks over all files on a repo.
>
> Bug: 1042324
> Change-Id: I2ebb7c3ec633f9d3a3774314799aa056bc2919c8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2003071
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Bug: 1042324
Change-Id: I452d98972f9b2c6d0a212029bac5aa6af57dce40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2038055
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 42a51f6af1.
Reason for revert: With this change also JavaScript code in the
V8 code base gets formatted. However, clang-format cannot deal with
V8 intrinsics, and therefore inserts a space between the `%` and the
intrinsics name. With that Clusterfuzz cannot detect intrinsics
anymore, and therefore the blacklisting of intrinsics would not
work anymore. The result is that Clusterfuzz then produces useless
test cases that are known to crash and could not exist in the wild.
Original change's description:
> Enable Javascript formatting by default
>
> This removes the need for explicitly passing `--js` to `git cl format`
> to format both JavaScript and TypeScript. It would reduce a significant
> amount of mental overhead for formatting code in DevTools frontend,
> which is primarily JS/TS.
>
> Fixed: 1007347
> Change-Id: Ia35c9af677d12ce9be72fe5fcdd6ceb6cb039c5f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2029371
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
TBR=tvanderlippe@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I13e8ce8916f0685b667607f2c8e68b1185d43329
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2041650
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
The Goma team releases the Goma client in depot_tools via CIPD.
Let me add all the Goma client release rotation so that they do not
need to wait for the review.
Bug: b/148421866
Change-Id: I45eb24ac8c34bba2183c16e72dcf0a9d7f13d603
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2040850
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
This reverts commit 1c8026d2f1.
Reason for revert:
Description should be set from gerrit before parsing the changes.
Original change's description:
> presubmit_support: Add --all-files options.
>
> Will be set when --all is passed to git-cl presubmit to execute
> presubmit checks over all files on a repo.
>
> Bug: 1042324
> Change-Id: I2ebb7c3ec633f9d3a3774314799aa056bc2919c8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2003071
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I8c455a269cdd6eb3dea9379faf351a04644bd23f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1042324, 1048885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2038052
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>