Commit Graph

882 Commits (e9730d75a00548a22e4392567243969d85c02dd4)

Author SHA1 Message Date
Jamie Madill 5e96ad12ac Re-land "git-cl: Fix format --dry-run not working with --full."
Re-land fixes format always saying the folder was dirty.

The --full option would skip setting the return value of the format
command when used with --dry-run. This in turn would cause the
presubmit check to always pass when --full was enabled in a repo by
default.

Was discovered in the ANGLE repository.

Bug: angleproject:4241
Change-Id: I986646336d1857af2826863ef4becbf2b9ee3049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1993910
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Jamie Madill 177710b35f Revert "git-cl: Fix format --dry-run not working with --full."
This reverts commit fc132e61db.

Reason for revert: Causes all presubmit checks to return dirty
format because of a non-zero diff output.

Original change's description:
> git-cl: Fix format --dry-run not working with --full.
> 
> The --full option would skip setting the return value of the format
> command when used with --dry-run. This in turn would cause the
> presubmit check to always pass when --full was enabled in a repo by
> default.
> 
> Was discovered in the ANGLE repository.
> 
> Bug: angleproject:4241
> Change-Id: Ie6cb423a6818c1e26781d77938a0dd22c02b4c16
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1987835
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Jamie Madill <jmadill@chromium.org>

TBR=ehmaldonado@chromium.org,jmadill@chromium.org

Change-Id: I0a4c51117ab20606f6dbb1f7a3ba40f87da1e939
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:4241
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1993907
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
5 years ago
Jamie Madill fc132e61db git-cl: Fix format --dry-run not working with --full.
The --full option would skip setting the return value of the format
command when used with --dry-run. This in turn would cause the
presubmit check to always pass when --full was enabled in a repo by
default.

Was discovered in the ANGLE repository.

Bug: angleproject:4241
Change-Id: Ie6cb423a6818c1e26781d77938a0dd22c02b4c16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1987835
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Jamie Madill <jmadill@chromium.org>
5 years ago
Andrew Grieve fa40bfa39b Update "git cl format --python" to default to PEP-8
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>
5 years ago
Garrett Beaty ed0cc5f6fd Add flag to "git cl format" to avoid invoking clang-format.
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>
5 years ago
Garrett Beaty 91a6f33848 Fix the --no-python flag for git cl format.
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>
5 years ago
Kevin Marshall 0e60ecd30e [git-cl] Add graceful error handling to "git cl archive".
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>
5 years ago
Anthony Polito 02b5af3575 fix hashtags: double colons are not hashtags
Bug: 896110
Change-Id: Ibaf36df48d9ea25e8ee633ca505fa7f7c2063df4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1944639
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Anthony Polito <apolito@google.com>
5 years ago
Brian Sheedy b4307d5c14 Switch yapfignore to fnmatch
Switches the yapfignore implementation in git_cl to use fnmatch instead
of glob. This ends up bringing the .yapfignore file parsing in line with
yapf's actual implementation, namely allowing uses such as '*pb2.py'
instead of having to list out each directory manually.

Bug: 1027953
Change-Id: Ibb1cb4252c546de6f1b1af720c4c29ffd0f7be0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1938026
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
5 years ago
Henrique Ferreiro 5ae4817ada Move .git_cl_description_backup to depot_tools dir
It was previously stored in each repository working dir, making it
neccessary to modify .gitignore files in many places. Save it in
depot_tools working directory, where there's already an entry in its
.gitignore file and no additional work is needed to hide this file.

Bug: None
Change-Id: I58102180e37358a206c8ecd1044aa772a684e066
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1944167
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Henrique Ferreiro ff24962cac Save .git_cl_description_backup in the working dir
Avoid cluttering the home directory by saving the CL description in
the project's working directory.

Bug: None
Change-Id: I42c78d03cd239e7c0453867f21fe4be57086722e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1925627
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 0db01f0fab git-cl: Make tests run on Python 3.
Bug: 1002209
Change-Id: I90de660afd901e544e5557f3af3a56cef4d6adaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891667
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
6 years ago
Edward Lemur 79d4f99506 Reland "git-cl: Fix some python3 compatibility errors."
This is a reland of c87ed60623
Fix on the reland: Encode change description before writing to temporary file.

Original change's description:
> git-cl: Fix some python3 compatibility errors.
>
> Also, fix bug in git cl status where the 'updated' field was used to compare messages, even though
> it doesn't exist (see [1]). This CL modifies it to use 'date', which does exist.
>
> [1] https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-message-info
>
> Bug: 1002209
> Change-Id: I5a5e1193b8502c3ad35d94808ea178cad7f44ac6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891259
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Anthony Polito <apolito@google.com>

Bug: 1002209
Change-Id: I2f0fc779ea3e361e6d32ee7ce1e53cbddb5cfdea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1898702
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
6 years ago
Edward Lemur 5ef16a3719 git-cl: Fix error message when -B is not specified.
Bug: 1018293
Change-Id: I9b915c3b4a1218e6318efde005c4f38243a35055
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1900309
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lesmes f6a2232b48 Revert "git-cl: Fix some python3 compatibility errors."
This reverts commit c87ed60623.

Reason for revert: 
Causes a regressions for CL descriptions on Windows

Original change's description:
> git-cl: Fix some python3 compatibility errors.
> 
> Also, fix bug in git cl status where the 'updated' field was used to compare messages, even though
> it doesn't exist (see [1]). This CL modifies it to use 'date', which does exist.
> 
> [1] https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-message-info
> 
> Bug: 1002209
> Change-Id: I5a5e1193b8502c3ad35d94808ea178cad7f44ac6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891259
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Anthony Polito <apolito@google.com>

TBR=ehmaldonado@chromium.org,apolito@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1002209
Change-Id: I004f202b12c6b99cb6b24cb12a14fba7898569e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1898547
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur c87ed60623 git-cl: Fix some python3 compatibility errors.
Also, fix bug in git cl status where the 'updated' field was used to compare messages, even though
it doesn't exist (see [1]). This CL modifies it to use 'date', which does exist.

[1] https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-message-info

Bug: 1002209
Change-Id: I5a5e1193b8502c3ad35d94808ea178cad7f44ac6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891259
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
6 years ago
Edward Lemur b983024505 presubmit_support: Fix tests on Python 3.
The problems on crbug.com/1017367 should have been fixed by crrev.com/c/1880013

Bug: 1009814
Change-Id: Ia98304ca983b4e7e293fedb9df1fee589de58ba9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1887714
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Jamie Madill dc4d19eeb6 git-cl: Add 'format-full-by-default' setting.
Lets the client repository make 'git cl format' use the
'--full' option by default. This solves issues when using less
common clang-format options that don't behave well with small
diffs. For example, AlignConsecutiveAssignments.

This is a replacement for the 'diff-lines-of-context' setting.

Bug: angleproject:4003
Change-Id: I81dc3b4992a7420e7235da88ec78e51ec4c0d24f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1879148
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
6 years ago
Jamie Madill 3671a6a217 Revert "git-cl: Add diff lines of context setting."
This reverts commit 812ac228e3.

Reason for revert: The fix was not sufficient to solve the git cl
format difference between 'git cl format' and 'git cl format --full'.
Looks like we'll need a different solution.

Original change's description:
> git-cl: Add diff lines of context setting.
> 
> Clients using some Clang-Format options can run into bugs when using
> 0 lines of context. AlignConsecutiveAssignments in particular is picky
> and behaves differently with 0 lines of context.
> 
> This behaviour lead to 'git cl format' behaving differently from
> 'git cl format --full'. That could also break presubmit format checks.
> Using >0 lines of context for 'git diff' fixes the inconsistency.
> 
> Add a setting 'DIFF_LINES_OF_CONTEXT' that can be controlled via
> codereview.settings. Defaults to zero to preserve the old behaviour.
> The setting allows the client to control the number of lines of context
> to use when running 'git cl format'.
> 
> Bug: angleproject:4003
> Change-Id: Ied2ebf23df4c41ba19bfbd5b8ddf526b56a20b31
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1864309
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>

TBR=agable@chromium.org,ehmaldonado@chromium.org,jmadill@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: angleproject:4003
Change-Id: Ib6b70969509a1e5446922d488f11d13a0c59c536
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1877003
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
6 years ago
Edward Lemur d2a5a4c043 Revert "presubmit_support: Fix tests on Python 3."
This reverts commit a834f39e21.

Reason for revert:
https://bugs.chromium.org/p/chromium/issues/detail?id=1017367

Original change's description:
> presubmit_support: Fix tests on Python 3.
>
> Bug: 1009814
> Change-Id: I2c2a835fc4fa0a7fc9e68dfff680fb0beacb491e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1869535
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=ehmaldonado@chromium.org,apolito@google.com

Bug: 1009814
Change-Id: I48907caeca9b9b32e4e3a7cb5a636280d017a4c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1877350
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur a834f39e21 presubmit_support: Fix tests on Python 3.
Bug: 1009814
Change-Id: I2c2a835fc4fa0a7fc9e68dfff680fb0beacb491e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1869535
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 202c559cac depot_tools: Include httplib2 using vpython.
Bug: 1002153
Change-Id: I940b9d834c2f76caab2bd86fc5d5d5c3b03b4b46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1871763
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 5b929a4926 depot_tools: Clean up auth.py
Bug: 1001756
Change-Id: I495991c30f7f00de17e7c098e2d88ef7783aff3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1865265
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Jamie Madill 812ac228e3 git-cl: Add diff lines of context setting.
Clients using some Clang-Format options can run into bugs when using
0 lines of context. AlignConsecutiveAssignments in particular is picky
and behaves differently with 0 lines of context.

This behaviour lead to 'git cl format' behaving differently from
'git cl format --full'. That could also break presubmit format checks.
Using >0 lines of context for 'git diff' fixes the inconsistency.

Add a setting 'DIFF_LINES_OF_CONTEXT' that can be controlled via
codereview.settings. Defaults to zero to preserve the old behaviour.
The setting allows the client to control the number of lines of context
to use when running 'git cl format'.

Bug: angleproject:4003
Change-Id: Ied2ebf23df4c41ba19bfbd5b8ddf526b56a20b31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1864309
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
6 years ago
Brian Sheedy 59b06a838a git-cl: Add yapfignore support to git cl format
Adds support for .yapfignore files to "git cl format" when formatting
Python files. yapf is supposed to parse the .yapfignore file in the
current working directory, but this appears to not work when files
are explicitly passed to yapf for formatting like they are in git cl
format. Instead, parse the .yapfignore file ourselves and skip over any
matching files.

Bug: angleproject:3985
Change-Id: I5e8469470fb8ddbaa914005b012ac1f39dfdd223
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1849807
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
6 years ago
Andrii Shyshkalov 2cbae8a8b9 git cl: retry-failed avoid not useful retries.
* don't retry successful (last build) or still running builders.
* don't retry CQ experimental builders.

R=ehmaldonado

Bug: 1012631
Change-Id: I2a155b274c822f8ead032098a08702f26362bee3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1851735
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
Ran:
  vi $(git grep --name-only iteritems | grep -v third_party)
  vi $(git grep --name-only itervalues | grep -v third_party)
  vi $(git grep --name-only 'print ' | grep -v third_party)

and edited the files quickly with adhoc macros. Then ran in recipes/:
  ./recipes.py test train

There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.

Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
6 years ago
Dan Beam d8b04ca8f7 git-cl: add --fixed / -x option to upload
This option take the same format as -b / --bug but
spits out "Fixed: #,#" instead of "Bug: #,#".

This CL also looks for fix-, fixed-, and fixes-
branch prefixes and uses those as cue to add "Fixed:"
to the CL description when editing. This is a slight
behavioral change for fix- specifically, as it used
to produce "Bug: " instead.

Bug: monorail:4470
Change-Id: Ib24a1ff33ca3674e53fc5437f459ea5708988290
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1846785
Commit-Queue: Dan Beam <dbeam@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Dan Beam <dbeam@chromium.org>
6 years ago
Edward Lemur b4a587df5e depot_tools: Remove depot-tools-auth
Users must use luci-auth now.

Bug: 1001756
Change-Id: I04cab6bdbfbd958f386a4cab761dfe4d34073afc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1849810
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
6 years ago
Andrii Shyshkalov aeee6a83d5 git cl: record additional tag for builds triggered via retry-failed.
Tag is the same as used by Gerrit plugin for the same functionality:
  retry_failed:1

R=ehmaldonado

Change-Id: I14ef435b676088c86ae7cc0536c6a68fa58bd89f
Bug: 445502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1848258
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur baaf6bec01 git-cl: Use buildbucket v2 to fetch tryjob results.
Bug: 976104
Change-Id: Icf761f1cd093f7600ad43b71af474e52780f1997
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1842335
Reviewed-by: Anthony Polito <apolito@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur c38e00052f Revert "git-cl: Set legacy properties."
This reverts commit f0faf48ddb.

Reason for revert:
Legacy properties are no longer used by Skia.

Original change's description:
> git-cl: Set legacy properties.
> 
> Will be removed back again on Oct 9, 2019.
> 
> Bug: 1004447
> Change-Id: I7003fac9ae8b184e2a7073b516535e8fd599f4f5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1825446
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

TBR=tandrii@google.com,ehmaldonado@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1004447
Change-Id: I4e1fb31b6179bf10c3d9554cd313f7040aaf1b1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1847959
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 1f3bafbab4 git-cl: Run using vpython
Bug: 1002153
Change-Id: I02ffa574f072575c4b6662a7f32678428ed3f85d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1845498
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 1ad5811acc git cl upload --retry-failed: search back up to 5 patchsets.
Make it work the same way as "git cl try --retry-failed".

R=ehmaldonado

Change-Id: Id3a709dc40b6b6d068acbba0c610da254ced8ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1845478
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
6 years ago
Edward Lemur 678a6843ee git-cl: Clean-up
Get rid of _process_codereview_select_options and detected_codereview_from_url and simplify issue parsing.

Change-Id: I4200fd83ee868587c8627d6771c64f886b34a88b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1838384
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 6215c79a8c git-cl: Better warning message for legacy buckets.
Bug: 976104
Change-Id: Ide06f73faf7a9ce6aa2d7f47deffc0c505dcdb14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1835017
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 4508b4223b git-cl: Set CC from watchlists only on first upload
This will prevent moving reviewers to cc when uploading patches.

Bug: 1010499
Change-Id: Ida16a4686f46350ba009bdaec1542895208c3f2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1835016
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
6 years ago
Quinten Yearsley a19d35307b Add `git cl upload --retry-failed`
The expected behavior is that for CLs that were already uploaded
before, where some tryjobs were run and failed, git cl upload
--retry-failed will be kind of like git cl upload --cq-dry-run
except it will only trigger tryjobs that failed.

Bug: 985887
Change-Id: I6371bca3ba501b1ea2cd7160e2f933530d7e633f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1828322
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Quinten Yearsley 983111f039 Add `git cl try --retry-failed`
Bug: 985887
Change-Id: I5aab64a21961ea8f57d77f6523f2ddc5f74e78a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818624
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lemur f0faf48ddb git-cl: Set legacy properties.
Will be removed back again on Oct 9, 2019.

Bug: 1004447
Change-Id: I7003fac9ae8b184e2a7073b516535e8fd599f4f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1825446
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lemur 4c707a2c53 git-cl: Re-write some tests to use mock.
I think this makes tests easier to read and write.

Change-Id: I9430a5d40e3466ff2a24b6b40253419aea3f30b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1820034
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Anthony Polito 8b95534d33 [git-cl] allow setting the bug during force mode
Bug: 1001709
Change-Id: I53e7699cb38d810d0a8c88d40907bf249174ad8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1804603
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Anthony Polito <apolito@google.com>
6 years ago
Edward Lemur ba5bc99b6a auth: Use luci-auth to get credentials.
Bug: 1001756
Change-Id: Ieab5391662e92ec9e2715a81fce2cef41717c2e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1790607
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Quinten Yearsley 90a67e2fc1 Remove some unused private things in git_cl
There are many functions in git_cl that appear unused, although
it's possible that some of them are used in other places, where
git_cl may be imported as a library.

This CL just removes some of the private ones, which at least
were not supposed to be used from other places.

Things removed here:

 - _get_commiter_timestamp
 - _git_amend_head
 - GitCookiesChecker._get_usernames_of_domain
 - constants MERGE_BRANCH, CHERRY_PICK_BRANCH;
   the comment says that these are supposed to
   be used in CMDland, but apparently they aren't.
   contextlib which is only used by this, is also
   removed
 - CodereviewSettingsFileMock in git_cl_test;
   it is not used anywhere in the test, and I
   assume that nobody's importing and using
   git_cl_test...

git_cl_test still passes, git cl seems to still work

Change-Id: Ib8eee0dfb181c8cda04c0894d2daea52b3ad42ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818621
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
6 years ago
Edward Lemur d4d1ba4971 git-cl: Use buildbucket v2 to schedule try jobs.
Change-Id: I3bad4314973cda7e285b5b9cb823f61cd7fb2dff
Bug: 976104
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1809516
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lemur 2c210a4908 Revert "git-cl: Use bb to schedule try jobs."
This reverts commit 5b6ae8bc74.

Reason for revert: Suspected breakage of wpt-importer (https://ci.chromium.org/p/infra/builders/cron/wpt-importer)

Original change's description:
> git-cl: Use bb to schedule try jobs.
>
> Bug: 976104
> Change-Id: I3423667f1ed9edfc5fa17842932de7704951fc62
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1801799
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

TBR=nodir@chromium.org,tandrii@google.com,ehmaldonado@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 976104
Change-Id: I885c1e71b34928c402d3375f820b28f3d6535c54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1806148
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 64d4a375c8 git-cl: Return exit code of bb when executing git-cl try.
Bug: 976104
Change-Id: I09412c19e373af05e629dccc9a9a4dbc760d3d89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1807613
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Daniel Bratell 4a60db4c3e Correct an error message where branch and url had changed places
With certain git remote problems an error message is emitted that
has the place of the url and the place of the branch wrong.

Example:
Remote "opera" for branch "git@github.com:operasoftware/gn-opera.git"
points to "bratell/no_jumbo_for_s", but it doesn't exist.

Should be:
Remote "opera" for branch "bratell/no_jumbo_for_s" points to
"git@github.com:operasoftware/gn-opera.git", but it doesn't exist.

R=dpranke@chromium.org

Change-Id: I484ac8af226903a49df1f62e837d01c345fb5f02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1806595
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Edward Lemur 125d60a103 git-cl: Remove ChangeListImplementation boilerplate.
Change-Id: I880c60e4b4e07fdb68a63af8d7a171d54371ee71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1802294
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lemur 5b6ae8bc74 git-cl: Use bb to schedule try jobs.
Bug: 976104
Change-Id: I3423667f1ed9edfc5fa17842932de7704951fc62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1801799
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago