Without this change, the script would try to query the subject of
branches that no longer exist (these are shown as
`{branch-name:GONE}` in the output of the command).
Bug: None
Change-Id: Ia8dafe428654a1ab995dcd0be794e6fd9e25bc7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4078970
Commit-Queue: Christian Flach <cmfcmf@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Chromium now has rust toolchain in a well-established directory, which is properly gated with `use_rust` gclient variable. External projects can setup this directory using their own toolchains and have rustfmt work properly in presubmit format checks.
Bug: 1395070
Change-Id: I3d1de8278b9da0db1cdb75673cb7d637ce0273ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4070004
Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: danakj <danakj@chromium.org>
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>
With nested batch files it is very common for /? arguments to end up
being interpreted as a request for help on the batch file "call"
command. That is, if a user invokes "goma_ctl /?" then this turns into
something like this:
@call ...\python3.bat %~dp0\.cipd_bin\goma_ctl.py %*
The name of the script to be invoked is ignored and this is treated
like:
@call /?
This is particularly problematic for commands like goma_ctl and
autoninja which don't print help if no arguments are passed, thus
making finding the correct help incantation slightly challenging.
This special-cases /? in these two batch files. Some other common batch
files were tested and found to be not affected, so while this is not a
complete fix it does hit some of the most important places.
Change-Id: Ic9b0455c2f8b085666862bc4495d9bad445dfeaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4080991
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
This reverts commit fa0a108281.
Reason for revert: Creating a null pointer issue
Original change's description:
> Updating Lucicfg V 1.35.0 to 1.35.1
>
> Version updates a bug where lucicfg fmt was erroring out on sentinel when it should safely continue
>
> Change-Id: Ic62d82176b4c9b8ded139338c7742a2b0cbe56a4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4072884
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Riley Wong <rgw@google.com>
Change-Id: I47c56e110f0b3acc2011fa0c169d979297856a3c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4072086
Reviewed-by: Chan Li <chanli@chromium.org>
Commit-Queue: Riley Wong <rgw@google.com>
Version updates a bug where lucicfg fmt was erroring out on sentinel when it should safely continue
Change-Id: Ic62d82176b4c9b8ded139338c7742a2b0cbe56a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4072884
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Riley Wong <rgw@google.com>
ninja.exe will be removed from depot_tools soon.
Calling ninja.py finds the ninja installed by DEPS or one in PATH.
Bug: 1340825
Change-Id: I32ed6d8e5b0498347042490eedeca19972d35233
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4061247
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Junji Watanabe <jwata@google.com>
This spares an unnecessary git fetch.
Change-Id: I552148bdfadc3482bda0d71d75aaf9d9ed61d75d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4062088
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This reworks the behavior of gclient sync --no-history to avoid fetching
the full repository history. This is accomplished by initializing a bare
repository and fetching the ref we are interested in.
Bug: 1305189
Change-Id: Ifea2a061308c354be15abd4e945141599ec20c9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3883766
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Travis Lane <travislane@google.com>
Only tests under tests/ are run on presubmit, so
presubmit_canned_checks_test.py is not run. Move these there and fix
them.
Bug: 1385693
Change-Id: Ib01a816b0a81919722ea49e5551010251c0e3287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4038514
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
This drops support for packaging toolchains based on VS 2017 and adds
support for VS 2022. This will allow us to package a toolchain for
building Chrome using the latest tools.
Bug: 1273169
Change-Id: I1981c935d1a9f3f4ae25e4643b9956fbdd705be1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4054349
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
In Skia (for example), GetPrimarySolutionPath works, but FindGclientRoot
does not (users tend not to use gclient to sync DEPS, etc).
Without this change, we'd get to the loop. If a user had pulled ninja to
third_party/ninja/ninja, then it would work just fine. If they hadn't,
python would throw an exception on the os.path.join line, because we'd
be passing a NoneType as the first argument.
Bug: chromium:1340825
Change-Id: Iab86450c5b6f00bc9c2716b9504debc9a56d9bb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4034942
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
A last minute change to the CheckLicense tests in crrev.com/c/4032366
used the _GetLicenseText function in the wrong place, thus neutering one
test and duplicating code in another. This fixes the tests so that they
minimize duplication and actually test the CSS/C style comments.
Change-Id: Ibbe880dec8d1e85416ed1b7ce94922c6f2c2a543
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4037103
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
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>
file:// references in OWNERS files can become invalid when the file
is moved or deleted.
Bug: 1385205
Change-Id: Icf1a65b3d96d6ad298eac6645d8f692cb09dc75a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4029143
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Victor Vianna <victorvianna@google.com>
The current message prints a regular expression.
This new message prints the correct copyright header which can be
copy-pasted into new files.
Bug: 1376752
Change-Id: Ifb03924641ad75d2b58158a752e0a62648436edc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4032368
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Some recent "improvements" to CheckLicense were buggy, at least
partially because I did not increase test coverage when adding new code
paths. This change fixes two known mistakes and greatly increases test
coverage.
One bug was that the code assumed that match.groups()[0] would always be
the current year, but that assumption is invalid when a license regex is
passed in.
Another bug is that the new_license_re took away the possibility of the
license ending with */ but that is used in .css files.
The increased test coverage catches these and validates other
assumptions around new files.
The failures were reproduced and then the fixes validated using this
command:
vpython3 tests/presubmit_unittest.py
Bug: 1098010
Change-Id: Ic91ca9f7a182660aef7b1eead79e841f58e15a3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4032366
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
This reverts commit 63fea808b0.
Reason for revert: broke bot_update for dart, b/259380822
Original change's description:
> Reset origin/HEAD in git_cache if it points to master
>
> This change resets refs/remotes/origin/HEAD if it points to master. With the master to main migration going on with chromium repositories, some of the cached git repositories end up pointing to master instead of main. This change aids in fixing this issue.
>
> Bug: 1364030
> Change-Id: Ic181b0179daf7b2b842cff7f7187d94d9fb20007
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4029356
> Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1364030
Change-Id: I96842c15eba886f5b95cdd10f323b907d5ea165d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4030304
Reviewed-by: Gavin Mak <gavinmak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
This change resets refs/remotes/origin/HEAD if it points to master. With the master to main migration going on with chromium repositories, some of the cached git repositories end up pointing to master instead of main. This change aids in fixing this issue.
Bug: 1364030
Change-Id: Ic181b0179daf7b2b842cff7f7187d94d9fb20007
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4029356
Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
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>