When user.email is not configured in git, git-cl tries to call
presubmit support with --author None, which makes git-cl crash.
Bug: b/150870673
Change-Id: Idc42ba2b970340ed93e1e92f65850fc1a12336d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2090375
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
When no -v flag is given, the verbosity defaults to None instead of 0,
so set 0 as a default.
Bug: 1058315
Change-Id: Id69e62550b33cd18bb1e5aed9cdc3c94f1488516
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2088193
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 684096347b.
Reason for revert:
Breaks git-cl split.
https://bugs.chromium.org/p/chromium/issues/detail?id=1054888
Original change's description:
> Improve git cl split
>
> This CL changes the behavior of `git cl split` to split the change
> by the size of the resulting CLs. For now, this is based on the number
> of bytes changed, and not by the number of changed lines. Depending
> on the shape of change, this may still produce more CLs than expected
> (and possibly more than before).
>
> A future change will switch the split to be based on the number
> of affected lines, and also introduce a mode to base the split
> on the number of affected files.
>
> Bug: 998922
> Change-Id: I49f868972a61b89b426ef9e2ceedc733eacb4350
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1778744
> Commit-Queue: Yannic Bonenberger <yannic.bonenberger@gmail.com>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
TBR=fdoray@chromium.org,dpranke@chromium.org,yannic.bonenberger@gmail.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
Bug: 998922
Change-Id: I466e1245d5f1c934443d850c48c42d3e694e71c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2080205
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Run custom git commands (e.g. git-cl, git-new-branch) using Python 3
when GCLIENT_PY3 is set to 1.
Bug: 984182
Change-Id: I81635b6cb83b2e0945d6596a7dc363f702075466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079704
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 488712ab57.
Reason for revert: Breaks when running on vpython3
Original change's description:
> my_activity.py: Run using vpython3 by default.
>
> Also, prompt users to use vpython3 when running my_activity.py
> using Python 2.
>
> Change-Id: I078517832520b3c7baf3324f83e9a3b5194a5bcb
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079703
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
Change-Id: Ib217e8ec3613ee6645149f3d78ef9534ac68af8b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2080201
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Run roll-dep using Python 3 when GCLIENT_PY3 is set to 1.
Bug: 984182
Change-Id: I511b4cf34b4f5522218a24dff6d0ce9ef5c36c4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2080614
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Also, prompt users to use vpython3 when running my_activity.py
using Python 2.
Change-Id: I078517832520b3c7baf3324f83e9a3b5194a5bcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079703
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
As we update scripts to run Python 3 by default, we want to provide
developers a way to execute scripts on Python 2 if they encounter
any problems.
This change only affects Linux/Mac and not Windows developers.
Bug: 984182
Change-Id: I7c7bd2a45ef50e340f6f2b85e9bc8b63f22d8678
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079701
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Remove input and output stream, that always pointed to sys.stdin
and sys.stdout.
Add tests for DoPostUploadExecuter.
Bug: 1042324
Change-Id: Ib5d092706a242ae97ec877af5dbceef6db7cbb73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079411
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of 35b70cac56.
With the recent vpython3 PATH fixes, hopefully this should pass now.
Original change's description:
> cros: switch CrOS programs to python3
>
> 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>
Bug: 997354
Change-Id: Ic7e040af6a34d112cd0a1c1421cdd25bc557ee19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2052625
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
PRESUBMIT.py scripts are executed in presubmit_support.py using exec().
Since PRESUBMIT.py scripts might not be yet compatible with python 3, we
have to execute presubmit_support.py using python 2.
git_cl.py imports presubmit_support.py, and executes presubmit checks using
presubmit_support as a module. This forces git_cl.py to be executed using
python 2 to maintain compatibility for PRESUBMIT.py scripts.
This change allows git_cl.py to be executed using python 3, while
presubmit_support.py is executed using python 2.
Similar changes for post-submit hooks and git-cl try masters will follow.
Bug: 1042324
Change-Id: Ic3bb1c2985459baf6aa04d0cc65017a1c2578153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2068945
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of 9ee86e5a46
Fix: s/Httplib2Error/HttpLib2Error
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>
Bug: 1050380
Change-Id: I9aec01088b0b1c408a1292106d0b21e6d8997040
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2066666
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This will make `vpython3` explicitly opt-in (so it will now behave the
same way that it does on bots).
R=qyearsley@chromium.org, smut@google.com, tandrii@chromium.org, vadimsh@chromium.org
Bug: 1051595
Change-Id: I80cbc640ec76756381d8b1cc2755363180534b96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2072361
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
In Python 3 the semantics of `raise StopIteration` inside a generator
function changed.
Bug: 1002209
Change-Id: I51222a5006c4024b3a6a06d344423ee36870825a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2071056
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>