Commit Graph

1114 Commits (8454fc2458b2421e0e339714c6ff7e6fffb70dc4)

Author SHA1 Message Date
Bruce Dawson 8454fc2458 Remove Python 2 support for PRESUBMIT.py
The presubmit system still supports invoking PRESUBMIT.py files using
Python 2. This has recently been turned off on the bots so this change
removes support more completely.

There are still some python3 parameters being passed around - it seemed
better to do the simplest possible removal now, with a follow-up change
to remove more support code after this has sat for a while.

Tests run from PRESUBMIT.py files could still be run using Python 2, but
those should also have been addressed already. Removing support for that
will be done in a subsequent change.

Bug: 1207012
Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
2 years ago
Josip Sokcevic 7958e30579 Revert "Move scm.py to lib/"
This reverts commit 688adfe276.

Reason for revert: breaks try jobs

Original change's description:
> Move scm.py to lib/
>
> It belongs there.
>
> Change-Id: I286b50c43c587c39557fc508175efbd4b0f51d51
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289680
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Change-Id: I662907b8bb4b2e7db82409bd34c3905db7961a12
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300261
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Josip Sokcevic 688adfe276 Move scm.py to lib/
It belongs there.

Change-Id: I286b50c43c587c39557fc508175efbd4b0f51d51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289680
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 5051ffee8a Enroll infra repos in stacked changes dogfood.
Bug: b/265929888
Change-Id: Ie4315fd110d5cdedb62dfc001ed5073c5bed4cfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300858
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 7603f04d42 Add external changes for stacked-changes dogfood.
Bug: b/265929888

Change-Id: Idc280549c7e41d6665173ef566637b48c2980e09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300530
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 74c53b6222 Allow for reusing the `main`/`master` branch.
Bug: 1416631
Change-Id: I498e54e46c4ce97cb5f7f43f1f484640e74ada44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300529
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang d75fc885fd [stacked-changes] Enforce -f and add --cherry-pick-stacked to skip interaction.
Bug: 1420363
Change-Id: I9b58f0126e05a558b42721222014392e9b527a25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4298829
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic 512fd3bd85 Extract searching relevat files in utils function
This change introduces lib/ directory which will be used for classes
that are considered libraries and used by multiple executables.

Change-Id: I3da126778bf5ffdb28d7a3c2b966c85de08ba717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289679
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang b54d0f013b Only trigger stacked changes dogfood path when in squash mode.
Bug: 1419551
Change-Id: Idbc345798ba81c3e1abd2038db8fadbef0b7391e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4291331
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Victor Hugo Vianna Silva dd03016926 Don't prompt for confirmation in `git cl upload --dependencies`
This is a pretty intentional command, I don't see why the confirmation
would be required.

Bug: None
Change-Id: I111bb39e3b5f467901be5c986847ace3c6efa7ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4261467
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 6b98cdcbc1 Check for detached HEAD state.
Bug: 1416683
Change-Id: I538715d05170662001ac7193a86dbd2e7f50e3f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4258505
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 6215dd0365 stacked-changes: Skip empty branches.
Changes:
- _UploadAllPrecheck() returns a list of cls to upload that skips any empty commits in the stack.
- If the current branch is empty, we throw an error.
- UploadAllSquashed() now computes the parent to use for the squashed and cherry-pick flow.
  - for cherry-pick it uses the gerrit_squash_hash of the next cl in `cls`. This means it could be the gerrit_squash_hash of the direct ancestor OR the closest non-empty ancestor branch.
  - for multiple squashed commits, the first parent passed in is either:
     - the closest ancestor with a gerrit_squash_hash OR the common ancestor shared with the root of the tree.
- PrepareSquashedCommit() and PrepareCherryPick() now both require a parent passed in.

Bug:1411878, b/265929888
Change-Id: I7dba289defb40ed0464eabdb7e90810353ef155f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4220412
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang c4ac30261d Revert auto-cc behavior back to original and fix comments.
Bug: 1411521, b/265929888
Change-Id: I2d5908f4fb54ad11914d061539c4677e8320c163
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4205471
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 562481d6a9 Add dogfood path.
- don't use `wip` as default for all dogfood changes
- don't use description hashtags for all dogfood changes

Bug: b/265929888
Change-Id: Ie19dedc980268e8a8d7ccf72c63b2a02790fb5bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4198118
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang dd12deb5f5 Check for stacked changes dogfood var.
Bug:b/265929888
Change-Id: Ibf1203994dea6e9db72fe4a954a2f6f24e30105b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4197875
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang c023a6302f Always set issue for branch, not just when newbranch is passed.
Bug: 1410392
Change-Id: Ib9842a4924a6df486dc8b0ee37e673286139f62a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4196054
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 44e9bee34f Allow --force to be used in cl patch with --reapply
Bug: b/265929888
Change-Id: I7ed00d70d18463b3394915ae4c74f853d05cb88d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4191996
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang c710e2d56a Connect new stacked changes implementation.
Bug: b/265929888
Change-Id: I89f669d9d0a11f09a89c378222e6780ac9fcec34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4189199
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 4049791e10 Create PostUploadUpdates func.
Bug: b/265929888
Change-Id: If74949bfb6aafefc789d4e5e025ec15e81197380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4189838
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang a8db0cbb86 Remove unused git cl upload args.
Bug: b/266235601

Change-Id: Iedefc213640faa664b05396565a4c158bfaa4403
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4166483
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang a1abbeda6b [stacked-changes] Add refspec func.
Bug: b/265929888
Change-Id: Ie8bd21b4f1b43a40f303dc1c93fc58becc76f9e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4182845
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang b88a4343de [stacked-changes] Prepare squashed commit
Bug: b/265929888
Change-Id: Ia492666a5707996d94a4b6f7668ceaeb0eda8c39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4182841
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
mlcui 7a0b4cb1e7 git_cl: Fix crashes when using --no-squash with detached HEAD
Bug: None
Change-Id: If69d4f558bd01c439a68dfdab76755487b58dca0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4183546
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Michael Cui <mlcui@google.com>
2 years ago
Joanna Wang e852391441 [stacked_changes] Create cherry-picked commit.
Bug:b/265929888
Change-Id: I4277474c1f09e4ac6ea6ebb5d9d340f22365f542
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178924
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang b46232e729 [stacked_changes] Add Changelist._PrepareChange() common func called before creating commits.
Bug: b/265929888
Change-Id: I18a0c5ba6757aef91e750b9703079c96b090dc1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178920
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang ab9c6ba27f Make cwd optional for scm.IsAncestor()
Bug:b/265929888
Change-Id: I9f25cd26eaf2d708ce3ac7d86503bb2c295c8406
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178351
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang 18de1f68e6 [git cl]Add precheck function for stacked changes upload.
High-level rough draft: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4166282

Bug: b/265929888

Change-Id: I7881ade0ea97d7537e1dd40ab484ee5ef828aa34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4175861
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 39811b1915 Remove TBR from git cl
Bug: b/266235601
Change-Id: I8122cf38d5a2c6879c32eafc6abd8fa306095125
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4185277
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang c8f23e26be Revert "Remove rietveld.cc to test removing all reitveld config sttuff."
This reverts commit 8c5174b527.

Reason for revert: Need to replace this before removing.

Original change's description:
> Remove rietveld.cc to test removing all reitveld config sttuff.
>
> Bug:b/266001713
> Change-Id: Ib5342e7519d7f7eaccf0a0a6f4a39c13677406bb
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178919
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Joanna Wang <jojwang@chromium.org>

Bug: b/266001713
Change-Id: Ief110063e7146f045df669ec138c4f01eccc44d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4182421
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 8c5174b527 Remove rietveld.cc to test removing all reitveld config sttuff.
Bug:b/266001713
Change-Id: Ib5342e7519d7f7eaccf0a0a6f4a39c13677406bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178919
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Weilun Shi 4f50adb332 Remove the one-linear check for the validate_prefix file
The validate_prefix file is now rolled out on prod so we
don't need that check any more.

Bug: 1116488
Change-Id: Ibbbfd29366e3e41d8e52d65dd7553f2e521ffd63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4167358
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Weilun Shi <sweilun@chromium.org>
Commit-Queue: Weilun Shi <sweilun@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak 6f905470df Print overview of external changes
This gives users an idea of what changes they are applying.

Bug:1382528, 1405491
Change-Id: Icb1e94f193b9cba3d80cc918c2abb11c2527ad3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4082289
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Orr Bernstein 0b96058844 Add an option to 'git cl web' to print the issue URL instead of opening it.
This new option (-n,--no-browser) prints the issue URL instead of opening it in
the browser. This is helpful, for instance, if you're SSH'ed in from a
Chromebook.

Change-Id: I28793280901f054af4eed2dbf2ce1fd109b8d37b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4121245
Commit-Queue: Orr Bernstein <orrb@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
2 years ago
Gavin Mak 591ebafe68 Fix external changes patching when issue number ends with <= 09
A change ref's format is: refs/changes/X/Y/Z where X is last two digits of the CL number, Y is the entire number, and Z is the patchset number.

In cases where Y ends in XXXX09, for example, we incorrectly fetch
refs/9/XXXX09 instead of refs/09/XXXX09.

Bug: 1382528
Change-Id: Icc0b08e9ee451a75c07039913418a6802b2b62fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4080591
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak f35a9ebe8a Don't prompt unsignificant external changes
Description changes shouldn't prompt. Changes like these that don't
change code or the merge base won't get overriden anyway.

Bug: 1382528
Change-Id: Ie1947a28ea97a8383a791e76738a2ad20c349878
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4033329
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak 4e5e39951e Handle external changes on `git cl upload`
upload currently overwrites any external changes, e.g. edits/rebases
in Gerrit. Check for these on upload and provide the ability to
incorporate those into the CL.

Bug: 1382528
Change-Id: Id32bf8804c4cdeb12b6a5a7cf206e033bbccd453
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3975855
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak be2e926c5e Add new constants for last-upload-hash and gerritsquashhash
Also add comments.

Bug: 1382528
Change-Id: If4311f36e7d1f591be48a6d0de772701290d69db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4015279
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
2 years ago
Brian Sheedy 7326ca218b Add post upload Python 3 option
Adds --no-python2-post-upload-hooks to git_cl.py. This causes any
post upload hooks to only run under Python 3. Without this, uploading
CLs from builders that omit Python 2 causes the CL the step to fail
after the CL is uploaded.

Bug: 1340617
Change-Id: I5fb45922fb05b28ad570091f9e285dd533d92336
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3996467
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
3 years ago
Aravind Vasudevan c950858a72 Update banned word regex matcher
The change updates git_cl to check for "banned words" too in the stdout to add helpful feedback when the upload fails due to banned words.

Bug: 1375130
Change-Id: Ic29faae9d9601face8455ffbb7314955261ffd57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3961632
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
3 years ago
Daniel Cheng 403c44e293 Add a --max-depth option to git cl split
For some types of changes, git cl split generates too many small CLs.
--max-depth provides one way of generating larger CLs when the author
judges that the larger CLs do not adversely affect reviewability (e.g.
20x 1 line CLs packed into 1x 20 line CL is generally fine).

Fixed: 777781
Change-Id: I64426ff4723fbc412fbc47f3cc12767433aeb8ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3933974
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
3 years ago
Garrett Beaty 08bb5c487f Use the gerrit host when setting gitiles commit.
Currently, the --revision flag to git cl try will cause a gitiles commit
to be set that uses the provided revision, the gerrit host and project
of the CL to test and the target ref of the CL to test. Since the flag
is intended to control the version of source to check out and have the
patch applied to, using the gerrit host instead of the gitiles host will
result in gitiles commits that won't match the repo_path_map in gclient
configs.

Change-Id: Ie391cc9c636f3a9c87116dbb781267031569e67b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3907186
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
3 years ago
Joanna Wang 46ffd1bca1 Allow sso remotes for `git cl status`.
Bug:1364237
Change-Id: Iff3419097f86db125990001fe316c9c52974e3b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3899165
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
3 years ago
Fabrice de Gans ecfab09639 [code-health] Run XML pretty_print.py with vpython3
Bug: 942720
Change-Id: I281a2e39efe653d37fb115bf99f7680b57073cb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3900835
Commit-Queue: Fabrice de Gans <fdegans@chromium.org>
Auto-Submit: Fabrice de Gans <fdegans@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Gavin Mak 0f1addcbe9 Reland "Remove old DepotToolsOwners implementation"
This is a reland of commit 10dbd7babd

Original change's description:
> Remove old DepotToolsOwners implementation
>
> code-owners should have been enabled for most hosts that depot_tools
> supports by now. Remove our own implementation and rely on code-owners.
>
> Change-Id: Iaf0d3db65b2e5063b67d42b92188c4ec51d2cd9a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3783475
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Change-Id: Ic87f34411bb38b91fcf49adb07601ae10244e828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3881043
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
3 years ago
Thiago Perrotta b0fb8d570d Introduce --send-email flag as an alias to --send-mail for `git cl upload`
Vanilla git has a git-send-email(1) subcommand. `git cl upload` should
follow suit by using the same flag name to be consistent and avoid
confusion.

[1]: https://git-scm.com/docs/git-send-email

Bug: none
Change-Id: I47ff8e03bd11915e99804fe1695046d874efc4e0
Tested: `git cl upload --send-email` to upload this very own CL
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3854330
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
3 years ago
Gavin Mak a9677a5e9b Revert "Remove old DepotToolsOwners implementation"
This reverts commit 10dbd7babd.

Reason for revert: removal broke builders

Original change's description:
> Remove old DepotToolsOwners implementation
>
> code-owners should have been enabled for most hosts that depot_tools
> supports by now. Remove our own implementation and rely on code-owners.
>
> Change-Id: Iaf0d3db65b2e5063b67d42b92188c4ec51d2cd9a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3783475
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Change-Id: I781648f470e8f2c9d408ae7112cfc41060f5385d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3818251
Auto-Submit: Gavin Mak <gavinmak@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Gavin Mak 10dbd7babd Remove old DepotToolsOwners implementation
code-owners should have been enabled for most hosts that depot_tools
supports by now. Remove our own implementation and rely on code-owners.

Change-Id: Iaf0d3db65b2e5063b67d42b92188c4ec51d2cd9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3783475
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
3 years ago
Bruce Dawson eb8426e2ac Improve presubmit no-network handling
Recent gerrit issues made it obvious that "git cl presubmit" relies on
gerrit much more than most people would expect (the expectation is zero
for many people). This makes presubmits flaky or much slower under poor
network conditions, and it means that the presubmit step may drastically
underestimate how long it takes to run because of a
cl.FetchDescription() that may occur outside of the timed portion of the
presubmits.

This change wraps more network-touching steps in try/except blocks, to
make them robust. It also gets them to check for the existence of a
PRESUBMIT_SKIP_NETWORK environment variable. And, it prints the elapsed
time to get the CL description if this is inordinately long.

Bug: 1350227
Change-Id: I7954fd50e928fd24975a4f61a316cb280542ebbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3813095
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
3 years ago
Thiago Perrotta 16d08f04e3 git-cl: parse baseurl arguments eagerly
Currently, `git cl help baseurl` fails as it tries to execute the
subcommand, completely bypassing the help.

Parse the arguments early so that the help command runs cleanly for
baseurl.

Fixed: 1345909
Change-Id: Icad7aca6cdc7c9938e91a421cb72e08433a30fd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3776942
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
3 years ago
manukh 566e9d0177 [git-cl] If set, use `options.title` for initial uploads.
Change-Id: Ia57b7a7b769d352e05820af0e40a52fcab471ddb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3736424
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
3 years ago