Implicitly concatenated strings are not supported when setting new
revisions, so raise an error when attempting to do se.
Bug: 1060772
Change-Id: I74d39b9eb8dcc420e9b7787c90bee642beb783cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2099407
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
gclient executes `git rev-parse <ref>` to check if <ref>
already exists in the local clone, which succeeds when
<ref> is a git revision hash, even if it doesn't exist.
We execute `git rev-parse <ref>^{commit}` instead, which only
succeeds when <ref> resolves to a valid commit in the local
repo.
Change-Id: Ia1cdf7162c4c82a7e4214c6af375c1a9522d7b07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2095745
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
When running `git rev-parse REV^{commit}` in Windows, `^` must be
escaped.
However, it was escaped more times than necessary.
Split IsValidRevision to call ResolveCommit, add tests to ResolveCommit,
and run scm.py tests on Windows.
Change-Id: I761a820394c8b5410d68b6ccd6c352c41c30c88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2092904
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
stdout and stderr are bytes in Python 3 and must be decoded before
printing the exception.
Bug: 1060409
Change-Id: Ib855f6104919734b7505aa5e978ebe394a1e9db6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2097595
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
BUG=chromium:1060257
TEST=./recipes.py test run
Change-Id: Ie081430ff5f83964a53401099ce3c9bee682c7fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2097040
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: David Burger <dburger@chromium.org>
Reviewed-by: George Engelbrecht <engeg@google.com>
Commit-Queue: George Engelbrecht <engeg@google.com>
CQ added support to project-scoped accounts instead of previously
hardcoded commit-bot@ for working with Gerrit.
R=ehmaldonado
Test: `git cl status` on this very CL :)
Bug: 911811
Change-Id: I8f48a7bdc9dad9a5b71d266ccf7e9a493aa94aa9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2095986
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Also refactor code to eliminate multiple calls to _create_description_from_log.
Change-Id: I113134fbd90f396bdb6d561ed0369ea5ee9c78ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2090448
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
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>