This is a reland of 3c830222ae with a fix.
Previous CL relied on summary data of CQ votes provided by Gerrit,
which apparently isn't always present in the way I expected.
This resulted in "git cl status" returning "lgtm" instead of "commit"
on Skia recipe roll CLs, which resulted in recipe roller abandoning CLs,
and creating new ones (there might be a bug in recipe roller, too).
The fix is to iterate over all votes on CQ label and finding the highest
score, and then deciding on the state.
Original change's description:
> git cl status: differentiate "dry-run" from generic "commit".
>
> CQ vote now before
> +2 "commit" "commit"
> +1 "dry-run" "commit"
>
> R=ehmaldonado
>
> Tested: manual "git cl status" run locally.
> Change-Id: I342a3ac0830a67bf0e722c737ef00460a0df4b98
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1548287
> Auto-Submit: Andrii Shyshkalov <tandrii@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Change-Id: If9af5a2bf8f21d203b7a62740a27916eca0838ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1549640
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Running "git cl issue -r invalid_input" will now produce an error
message and continue, instead of crashing with a stacktrace.
Change-Id: I17626a513df904a1a3ff725ec7a17e8541db6bf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1538978
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
When an exception occurs in CheckCallAndFilter the push_returncode variable is used in the finally block without being initialized.
Traceback (most recent call last):
File "C:\Google\depot_tools\metrics.py", line 266, in print_notice_and_exit
yield
File "C:\Google\depot_tools\git_cl.py", line 5647, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\Google\depot_tools\git_cl.py", line 5629, in main
return dispatcher.execute(OptionParser(), argv)
File "C:\Google\depot_tools\subcommand.py", line 252, in execute
return command(parser, args[1:])
File "C:\Google\depot_tools\git_cl.py", line 4641, in CMDupload
return cl.CMDUpload(options, args, orig_args)
File "C:\Google\depot_tools\git_cl.py", line 1623, in CMDUpload
ret = self.CMDUploadChange(options, git_diff_args, custom_cl_base, change)
File "C:\Google\depot_tools\git_cl.py", line 2746, in CMDUploadChange
'exit_code': push_returncode,
UnboundLocalError: local variable 'push_returncode' referenced before assignment
Change-Id: Ife0e5226aa7e6127e8a508adb747f2c653ed8351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536033
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
For instance, if the bug-prefix is set to "b/", git cl upload will offer a
line with "Bug: b/", however it won't get stripped away if it's left blank,
unlike the default "Bug:" line. This change fixes that inconsistency by
also taking the bug-prefix into account when stripping.
Change-Id: Ib6e4d18c1ff52ec77cd1422be15b1e6920332238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528972
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jonas Termansen <sortie@google.com>
Warning message appears when trying to cherry-pick into a Chromium branch,
but doesn't actually mean anything right now.
"""
About to land on 3163. Continue (y/n)? y
It seems this repository has a Commit Queue, which can test and land changes for you.
Are you sure you wish to bypass it?
Press Enter to bypass CQ, or Ctrl+C to abort
"""
We want to disable until CQ for branches is fully developed.
Bug: 753213
Change-Id: I1cdfa084a6bad1be56b85a56e94e2dd27a099b2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1518291
Commit-Queue: Karen Qian <karenqian@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Example stderr output from Chrome:
[24599:24650:0306/123817.372418:ERROR:browser_process_sub_thread.cc(209)]
Waited 3 ms for network service
R=nodir@chromium.org
Change-Id: Idb71c9f3a2c735ee49b886896f55bdede559137c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1505792
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
In particular, only show robot comments from the latest patchset.
Bug: 924780
Change-Id: I12038ddd2d90a5cb561b248de3fd37908d5b927e
Reviewed-on: https://chromium-review.googlesource.com/c/1457282
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Git requires single quotes for paths with spaces.
We however need to convert single quotes to double quotes for Windows to treat such paths as a single path.
Bug: 916922
Change-Id: I89b23552a2a32d5aa58ea4f207690595823692d5
Reviewed-on: https://chromium-review.googlesource.com/c/1467301
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Sometimes CL author is also listed as OWNERS but want to find a co-owner
to review CL. Currently "git cl owners" is unhelpful as it consider the
author's ownership as enough.
Add a --ignore-self parameter to "git cl owners" that will cause the
tool to ignore author's ownership when looking for a reviewer.
Bug: none
Change-Id: Iba110a465a552cd6befb46c77b2e65f60b663a13
Reviewed-on: https://chromium-review.googlesource.com/c/1459625
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Commit a185e2e3c8 removed the Rietveld code review
implementation, albeit hasn't expunged all references to Rietveld. This leads
to an assertion error when running |git cl format| on a non-Gerrit change.
There appears to have been a recent attempt to articulate this error better in
a185e2e3c8, albeit not fix the underlying issue.
This change addresses the immediate issue by defaulting the code review
implementation to Gerrit rather than Reitveld.
R=joenotcharles@google.com, tandrii@chromium.org
Bug: 914150
Change-Id: I64d33e5a172cc43339ec417f7f0a7820e0337772
Reviewed-on: https://chromium-review.googlesource.com/c/1372928
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bryce Thomas <bryct@amazon.com>
Adding the diff.noprefix flag to .gitconfig broke python
formatting because git diffs were being parsed with regex
that relied on the default git diff prefixs.
This CL fix's this issue by always specifying prefix flags
for git diffs when formatting python.
Bug:846432
Change-Id: Ifde305da9574e6b46455a0237703b7364fac77e4
Reviewed-on: https://chromium-review.googlesource.com/c/1349809
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
On my machine, saves 0.16s of time while loading git cl:
from 0.32s to 0.16s.
R=ajp, ehmaldonado
Change-Id: I0febca43f11514da3e3f7be7e2c0184fb9e17409
Reviewed-on: https://chromium-review.googlesource.com/c/1344641
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Enables python formatting in git cl format by default
for all files that have a .style.yapf file in a parent
directory up to the repository root. If no .style.yapf
file is found the --python flag still needs to be
set explicitly for python formatting to be enabled.
Also adds a --no-python to explicitly disable python
formatting on any file even if a .style.yapf file is found.
This allows default formatting to be enabled on a per
project/directory basis by adding a .style.yapf file.
Bug:846432
Change-Id: I40d899ec1a3e0dfca445e04b91befab113416175
Reviewed-on: https://chromium-review.googlesource.com/c/1316415
Commit-Queue: Aiden Benner <abenner@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
git cl format --python currently breaks on windows
because FindExecutable('yapf') returns .../depot_tools/yapf
(a py file) instead of .../depot_tools/yapf.bat. Also
yapf.bat tries to run the yapf py file without vpython
which breaks the yapf dependency.
This CL fixes these two issues.
Bug:846432
Change-Id: I551a4c1e6367074fa76767851bd34feb2dcfb6a2
Reviewed-on: https://chromium-review.googlesource.com/c/1341236
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aiden Benner <abenner@google.com>
Currently git cl owners tries to fetch the current reviewers of a CL
from gerrit. However, this fails with a KeyError when there are no
reviewers currently. This cl fixes that bug.
Bug: 895722
Change-Id: I78a998ee234d207523aa2cef4b5058ba7cfecbc2
Reviewed-on: https://chromium-review.googlesource.com/c/1330122
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Except when TBR is active, because it's not clear how to
compute max score for Code-Review label before uploading a change.
Tested with this very own CL:
To https://chromium.googlesource.com/chromium/tools/depot_tools.git
* [new branch] c78de165c7 ->
refs/for/refs/heads/master%ready,notify=ALL,m=Initial_upload,r=ehmaldonado,
cc=ajp,cc=chromium-reviews@chromium.org,cc=iannucci+depot_tools@chromium.org,
l=Commit-Queue+1,hashtag=git-cl-upload
R=ehmaldonado
Bug: 877717
Change-Id: I464d9df2814bd830dd608bb881040e2dd3c41dbb
Reviewed-on: https://chromium-review.googlesource.com/c/1307052
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
For other hosts, behavior is not changed.
Tested on this very CL:
To https://chromium.googlesource.com/chromium/tools/depot_tools.git
* [new branch] 9057c2235b ->
refs/for/refs/heads/master%ready,notify=ALL,m=Initial_upload,r=ehmaldonado,cc=chromium-reviews@chromium.org,cc=iannucci+depot_tools@chromium.org,hashtag=git-cl-upload
R=ehmaldonado
Bug: 877717
Change-Id: I951fc576105211590c6c303ce0ed2fe142628224
Reviewed-on: https://chromium-review.googlesource.com/c/1307051
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
It is not recorded by the server, but causes a 500 status anyway.
Bug: 896868
Change-Id: Ic3bf0d989bf3c3641dae9ea49a58ffb28f52e865
Reviewed-on: https://chromium-review.googlesource.com/c/1289769
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>