Commit Graph

1184 Commits (26b100def9195bedd794873b73a9529189d9e90a)

Author SHA1 Message Date
Brian Ryner 3d6dda8241 Always run yapf with vpython3.
The version we are using now does not run under python 2.7.

Add an explicit python_version 3.8 to the inline spec so that we don't
rely on vpython's default version. This is a no-op change when running with vpython3. We should run yapf under 3.11, but this needs additional testing and likely an update of zipp, so we'll do it separately.

Change-Id: If1fccbe6b13c77a770bd1a8c9de0789d543ba890
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5198109
Auto-Submit: Brian Ryner <bryner@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Lukasz Anforowicz 388f822682 Explicitly specify `--config-path` when invoking `rustfmt`.
This prevents `rustfmt` from looking up directory-specific configs (e.g.
`third_party/rust/chromium_crates_io/vendor/tinyvec-1.6.0/rustfmt.toml`)
and using them instead of the Chromium config.

Fixed: 1517348
Change-Id: I5231443479f1f417608ecac263808dc91963948f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5185319
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
1 year ago
Josip Sokcevic 0cba8dd68e [owners] Limit number of concurrent Gerrit connections
R=gavinmak@google.com

Fixed: 319469729
Change-Id: I955fa17c80cee25bc2163a8bca0234cdbb659f62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5186760
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Josip Sokcevic cd076ba1b0 [git_cl] Limit number of concurrent connections
When git cl status is executed, it's possible that Gerrit will throttle
some requests. This change sets upper bound of concurrent connections to
20.

R=gavinmak@google.com

Fixed: b/319248186
Change-Id: I51b1d87109447efc8c86d615f12bcafe8c317a90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5181274
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago
Josip Sokcevic 450aa8d76c [git_cl] Force lookup CL number
UploadAllSquashed doesn't have access to `cl` object and can't update
the issue number. When a new cl is uploaded with --dependencies flag,
`cl` that is passed to upload_branch_deps is outdated - GetIssue returns
None.

Instead of passing cl, or overriding cl in CMDupload with one generated
by UploadAllSquashed, simply unset lookedup_issue which forces GetIssue
to read value from git config.

R=gavinmak@google.com

Fixed: 1514055
Change-Id: I8a55807b097d464379aade20d9cfa3c01f1db69a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5148352
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago
Josip Sokcevic 31a99001bd Remove dead code
R=gavinmak@google.com

Change-Id: If27b290ebb575db5ec93b4abcb7f432bedd6f18a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153638
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago
Gavin Mak edba22d4eb Fix multiline comment formatting
Many incorrectly formatted comments exist from the switch to
4 space indent: https://crrev.com/c/4836379

Bug: 1514505
Change-Id: I6366f9da812919bd35b999f18fa8a49b7a66c09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153633
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Helmut Januschka 6444de14d1 fix crash in case HEAD exists as a file
Bug: 1428373
Change-Id: If9d988d542345dbfa0e02f7c3d6f935b48372df4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5018937
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Helmut Januschka <helmut@januschka.com>
1 year ago
Josip Sokcevic c90f05ebd3 [git cl]: Support --dependencies in new flow
This patch adds functionality for --dependencies if new stack change is
used. However, the user must ensure that parent branch didn't diverge by
running git rebase-update [-n].

Bug: 1441132
Change-Id: Ib2e3e841b6dd22bbdefdc7844d5d157b1d1241d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5095961
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
1 year ago
Dirk Pranke 081bca8cb3 git_cl: Attempt again to fix xml format on Win
It turns out that we need forward slashes in one place and back
slashes in two other places, so neither path by itself will work.

This CL changes things to do the slash substitution as needed.

Bug: 1502689
Change-Id: I05681ca5aff9f02a1c4ecc14c3c4e877312118ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5074657
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
1 year ago
Josip Sokcevic eb48a6ac0f git_cl: Fix xml format on Win
Diff paths are no longer normalized, and we can use forward slashes as
separators regardless of the platform.

R=dpranke

Fixed: 1502689
Change-Id: I75a2fe824972f0d98b28eb2146c6f05ee4ae2d75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5038641
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
1 year ago
Thiago Perrotta 197399a8ac depot_tools: add a `--dry-run` alias to `--cq-dry-run`
It is easier to remember.

Bug: none
Change-Id: I075fe57521c9743901f51bd1ed3476145553dc48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5010037
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
1 year ago
Takuto Ikuta 744bfd2a7b git_cl: show actual gerrit host instead of placeholder
This removes necessity of URL modification to open the settings.

Change-Id: I22314d3e04eac476499773a8680dec32a1886eb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4970438
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
2 years ago
Takuto Ikuta 8abeeaab0f git_cl: prepend http for go link
This allows users to click the URL from terminal.

Change-Id: I0b5c2b9d5a8221c41d5152b529edcf82f97464c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4969974
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Andrew Grieve 491aa5d18a Do not fail "git cl format" when google-java-format.jar is missing
The file is conditionally downloaded in chrome, and we do not want to
have "git cl format" fail when editing a .java file on non-linux /
non-android checkouts.

Bug: 1462204
Change-Id: I5fc3b74484e1d9304089118449678acb506d5831
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4943676
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Yiwei Zhang f2f500022d git_cl: add a long option for git cl patch -b
R=sokcevic

Fixed: 1492418
Change-Id: I09b7b05c8eb4968f079303406c474f90c34b66a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4937884
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Andrew Grieve 69e597f8e5 Do not fail formatting when google-java-formatter is not found
A missing google-java-format should not break older chromium branches
and non-chromium projects. This causes the formatting step to skip .java
files when google-java-format is not available, and introduces an
environment variable GOOGLE_JAVA_FORMAT_PATH to set a custom path.

Bug: 1491627
Change-Id: I5e3155553630ddc59c1a8d197e96079f6a372454
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4930437
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Arthur Eubanks 92d8c4e0cf [git-cl] Ignore moved/copied/deleted files for formatting purposes
Bug: 737568
Change-Id: I9888d1b2c392503a1d98579445cda8eee97bd07f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4904205
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Reviewed-by: Hans Wennborg <hans@chromium.org>
2 years ago
Andrew Grieve 3008d7ec82 git cl format: Enable google-java-format by default.
Removes --google-java-format and adds --no-java.

Does not provide a way to fallback to clang-format, since there is no
established way for projects to declare which formatters they prefer to
use.

Bug: 1462204
Change-Id: Ie116e73ccad0fbd55c968248ae2ebeca130a3f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4905866
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
2 years ago
Thiago Perrotta 853b29f65d depot_tools: add an `--auto-submit` alias to `--enable-auto-submit`
It is easier to remember.

Bug: none
Change-Id: Ic011c2b0bbbde364b69e5db91566748e72946264
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4892967
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
2 years ago
Eli Trexler 8609345923 Revert "Clear existing Change-Ids from description if issue is 0"
This reverts commit 36d937d16d.

Reason for revert: Not sure the best way to notify you about this, but suspect this is the root cause of https://chat.google.com/room/AAAAXGgrwSo/hZDeSAsoQ4k

Verified via rolling back depot_tools

Original change's description:
> Clear existing Change-Ids from description if issue is 0
>
> git cl upload may not create a new change even if issue is 0 because
> of a leftover Change-Id footer in the commit message.
>
> Bug: 1484251
> Change-Id: Ibee0542e0f5a2cbf930b1882892fbb7640054b69
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4880971
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1484251
Change-Id: Ic3230fd7432f57bf9f3d0266b2e2c0df6a7e9bae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4893199
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Gavin Mak 36d937d16d Clear existing Change-Ids from description if issue is 0
git cl upload may not create a new change even if issue is 0 because
of a leftover Change-Id footer in the commit message.

Bug: 1484251
Change-Id: Ibee0542e0f5a2cbf930b1882892fbb7640054b69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4880971
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Andrew Grieve d7ba85d1eb Add experimental --google-java-format flag to "git cl format"
Flag will be used to test out the formatter, and eventually be removed
and made default (or removed and abandon google-java-format)

Bug: 1462204
Change-Id: I3dc9a77fcabc7513674f5db5eab6979a97d2b315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4864924
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
2 years ago
Andrew Grieve cca48dbbaf Refactor "git cl format" formatters to use a common interface
No behavior change. This is to make it easier to add new formatters.

Bug: 1462204
Change-Id: Ifc9c46ad60fe5024f5dfb0cf781ff468b2cc1044
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4863139
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
2 years ago
Joanna Wang d4dfff088c Fix missing upstream messaging.
Bug: 1455494
Change-Id: Ie428c228d4a3fe2db1f95dbb9c642034de9eec79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4858989
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang bcba178212 Add missing --no-ext-diff when getting external changes.
Bug: 1441663
Change-Id: I66fc01e486ddddb6b8c296d1ed4faf22141b845e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4859062
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang 56ee228caf Reland "Remove unnecessary notify=None from git cl upload."
This reverts commit cea35a3f77.

Reason for revert: b/298657697 is unrelated to this

Original change's description:
> Revert "Remove unnecessary notify=None from git cl upload."
>
> This reverts commit 7688e78450.
>
> Reason for revert: afaict there is a gerrit notifications bug b/297928626 unrelated to this change but i'm reverting this anyway and relanding when the gerrit bug is resolved.
>
> Original change's description:
> > Remove unnecessary notify=None from git cl upload.
> >
> > This is a NOOP change for all cases except for "Publish comments on push" which gets fixed with this CL.
> > Our hosts have the notify on each patchset turned off.
> >
> > Bug: 1472724
> > Change-Id: I3672c383b1e4ca1f6243c9b9d2c906473f5037d9
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4797981
> > Reviewed-by: Gavin Mak <gavinmak@google.com>
> > Commit-Queue: Joanna Wang <jojwang@chromium.org>
>
> Bug: 1472724
> Change-Id: I3de1a25fe84a21a2adb8b4bbddb460dd45530418
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4817767
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Joanna Wang <jojwang@chromium.org>

Bug: 1472724
Change-Id: I63cdb99111ae89eb6edd5172d827f84b314c015e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4852217
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak 7f5b53ff8d Remove last py2 workarounds
python3 is the only supported version of python in depot_tools.

Changes include:
  * updating python version requirements
  * removing third_party/six

Bug: 1475402
Change-Id: Ib86231413fcac494ceb27d1783e53b9d86533c26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4845292
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Mike Frysinger 124bb8e53c switch to 4 space indent
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.

Reformatted using:
files=( $(
	git ls-tree -r --name-only HEAD | \
		grep -Ev -e '^(third_party|recipes)/' | \
		grep '\.py$';
	git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"

The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py

These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py

Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Daniel Cheng abf4847b04 Fix various type annotations in git_cl.py as reported by pytype.
Most of the changes are straightforward typo fixes.
Two more significant changes:
- the entire ChangeDescription class was moved earlier in the file so
  that it is defined before any type annotations that reference it.
- annotations that use list[...] have been changed to use List[...].
  While this is supported >= python3.9, it seems some parts of the
  Python toolchain (e.g. Python formatting) do not support this yet.

Change-Id: Ifb60f10e2424f79a19229328d19d9fd1d0e87dea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4824618
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
2 years ago
Daniel Cheng 66d0f15a56 Summarize number of commits being processed by `git cl upload`.
Occasionally, users can get a branch into a state where `git cl upload`
takes a long time because it is operating on an unexpectedly large diff.
One way where this can happen is when the local view of origin/main is
behind and someone force-patches in a CL based on a newer origin/main:
git cl upload will happily consider all the origin/main commits it
does not have in its local view of origin/main to simply be part of the
diff.

As this is a rather frustrating user experience, make it a bit easier to
realize when this sort of thing is happening by summarizing the number
of commits `git cl upload` is processing.

One alternative would be to stats about the diff; however, calculating
the number of commits is considerably faster than calculating the actual
diff. A quick local test shows that calculating the diff for 10k commits
takes nearly 20 seconds, while calculating the number of commits takes a
150 milliseconds.

Change-Id: I0e8706f164f6bf669f36f4792401589644be38b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4819796
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Alexei Svitkine d40cda515b Improve `git cl format` for metrics XML files.
- Remove a reference to rappor, which doesn't exist anymore
- Don't error if an XML file is found with a different name

The error would happen because we'd try to run pretty_print.py without
a filename argument.

Change-Id: Ifa77af07dcd9113540890863a9d1d3198bae59a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4762087
Reviewed-by: Andy Perelson <ajp@google.com>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
2 years ago
Joanna Wang cea35a3f77 Revert "Remove unnecessary notify=None from git cl upload."
This reverts commit 7688e78450.

Reason for revert: afaict there is a gerrit notifications bug b/297928626 unrelated to this change but i'm reverting this anyway and relanding when the gerrit bug is resolved.

Original change's description:
> Remove unnecessary notify=None from git cl upload.
>
> This is a NOOP change for all cases except for "Publish comments on push" which gets fixed with this CL.
> Our hosts have the notify on each patchset turned off.
>
> Bug: 1472724
> Change-Id: I3672c383b1e4ca1f6243c9b9d2c906473f5037d9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4797981
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Joanna Wang <jojwang@chromium.org>

Bug: 1472724
Change-Id: I3de1a25fe84a21a2adb8b4bbddb460dd45530418
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4817767
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 7688e78450 Remove unnecessary notify=None from git cl upload.
This is a NOOP change for all cases except for "Publish comments on push" which gets fixed with this CL.
Our hosts have the notify on each patchset turned off.

Bug: 1472724
Change-Id: I3672c383b1e4ca1f6243c9b9d2c906473f5037d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4797981
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Gavin Mak cc97655889 Reland "Drop py2 support in gerrit and git related files"
This is a reland of commit b5c7f4b46c

Original change's description:
> Drop py2 support in gerrit and git related files
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: Ie4ee18d297081b3aa0206b8d7ce6461819bff0ca
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4809560
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1475402
Change-Id: I194180494071777b7b9dd91a5c8edabbbf5484c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811218
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Aravind Vasudevan b8164180d2 Warn when fsmonitor is enabled and git submodules are used
Change-Id: I181bf180f762282d5b4bc614d12a91125f56e063
Bug: 1475405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4814429
Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Gavin Mak 42674f5d2d Revert "Drop py2 support in gerrit and git related files"
This reverts commit b5c7f4b46c.

Reason for revert: missing a replace for urlparse.urlparse

Original change's description:
> Drop py2 support in gerrit and git related files
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: Ie4ee18d297081b3aa0206b8d7ce6461819bff0ca
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4809560
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1475402
Change-Id: Idd00fdfe0b3d62785da2789a7dfcc9fbc79b6385
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811623
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak b5c7f4b46c Drop py2 support in gerrit and git related files
python3 is the only supported version of python in depot_tools.

Bug: 1475402
Change-Id: Ie4ee18d297081b3aa0206b8d7ce6461819bff0ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4809560
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
mlcui c601e364af git cl presubmit: Add "base branch" usage hint
A base branch can be passed into `git cl presubmit` as a positional
argument, but the output for `git cl presubmit --help` did not mention
it until this CL.

Change-Id: I05d75af4fd175585a5e7ae74f2f4bb73227127ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4778138
Commit-Queue: Michael Cui <mlcui@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Struan Shrimpton 8b2072b3bd Remove Quick Run options
Quick Run and RTS are being removed from the CQ. This should remove
the -q flag from git cl
Here is the related announcement:
http://g/chromium-dev-internal/aMVTs_LCkYI
and retrospective: https://docs.google.com/document/d/1Jf9S2L_XN3wwCDRe7yYnPd9SH4vrPbKF3Xq8clLdL5Y/edit#heading=h.17wg41voij6q

Bug: 1469110
Change-Id: I57d90165a04c1bd9d2c06d0ba393097822b67e32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4731557
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Struan Shrimpton <sshrimp@google.com>
2 years ago
Victor Hugo Vianna Silva deff9a27cc [docs] Improve `git cl patch --help`
Change-Id: I001a1baafe2b136bbe89055fec5ae91118332d1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4660921
Reviewed-by: Andy Perelson <ajp@google.com>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Commit-Queue: Andy Perelson <ajp@google.com>
2 years ago
Anne Redulla 072d06e918 Created disable-auto-submit flag for git cl split
This CL adds a disable-auto-submit flag for git cl split.

Change-Id: Ibce0e06706390ff9429d59094fed2449096c631c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4659527
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
2 years ago
Rachael Newitt 03e4912518 Added topic flag to git cl split functionality.
Change-Id: Ie3314cfe45e008f1df8b21ff16abda0980a5225e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4653533
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2 years ago
Aravind Vasudevan 0e3589eaf8 Fix skip-ensure-authenticated config
https://crbug.com/603378#c4 introduces gerrit.skipEnsureAuthenticated as simple workaround to allow git_cl work with `sso://` URLs. However, git_cl still warns users to not use `sso://` and all the gerrit API calls break.

This change is a fix quick to allow git_cl to work with `sso://` when gerrit.skipEnsureAuthenticated is set to true in .git/config.

The authentication check will be fixed to support `sso://` is a follow-up change.

Bug: 1431292
Change-Id: Iefc43d205ac3b7fb67b32092567fd13eded205a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4404933
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Josip Sokcevic 43ceaf0353 Update message when external changes are detected
Provide a link to the external change patch diff and clarify prompt.

R=gavinmak@google.com

Bug: 1441902
Change-Id: I9e4853959fbe46c1e4e887d3a0d9e727570b22d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4564233
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic 2568d4c1eb Add additional check for PS parents
When updating with external changes, depot_tools applies diff between
patchsets. It's not sufficient to just check local `base` commit with
the latest remote since both could be updated (e.g. via rebase-update
and Gerrit rebase).

R=gavinmak@google.com, jojwang@google.com

Bug: 1448243
Change-Id: Ib92d2f3958de15090a261c810ad19bdf085219a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4559308
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 4786a41fb5 Allow users to mute stacked changes dogfood message.
Bug: 1443304
Change-Id: Idecda2ca5e059c069f38cf099e83e7e0ae932ce2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4537944
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Robert Iannucci 3d6d2d2500 [git-cl][presubmit] Remove references to LUCI_OMIT_PYTHON2.
This changes all references to the LUCI_OMIT_PYTHON2 environment
variable to instead assume that it is `'true'`.

R=sokcevic, tikuta

Bug: 1441784
Recipe-Nontrivial-Roll: build
Change-Id: Iea161a372adb68cdcb330d131df2c19ca2fe7b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4522480
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic 967cf672eb Revert "Reland "Remove Python 2 support for PRESUBMIT.py""
This reverts commit 119cff3d2f.

Reason for revert: some builders still call py2 presubmit
http://go/bbid/8781466817788761185

We need to clean up recipe first before relanding this

Original change's description:
> Reland "Remove Python 2 support for PRESUBMIT.py"
>
> This reverts commit d4c6cbeb61.
>
> Reason for revert: Python 2 invocations of the presubmit system
> should be gone now.
>
> Original change's description:
> > Revert "Remove Python 2 support for PRESUBMIT.py"
> >
> > This reverts commit 8454fc2458.
> >
> > Reason for revert: post submit hooks failing
> > https://crbug.com/1422416
> >
> > Original change's description:
> > > 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>
> >
> > Bug: 1207012
> > Bug: 1422416
> > Change-Id: Iaf3102e63ec3c698d0258fac5746dbd92c30edbb
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317176
> > Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
>
> Bug: 1207012
> Bug: 1422416
> Change-Id: I9521095989c708188fca0251fa13881e086b1395
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4516015
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>

Bug: 1207012
Bug: 1422416
Change-Id: Ifa775ca19f8c7b3c166eb89a255c25c20aaf4a98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4521578
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Bruce Dawson 119cff3d2f Reland "Remove Python 2 support for PRESUBMIT.py"
This reverts commit d4c6cbeb61.

Reason for revert: Python 2 invocations of the presubmit system
should be gone now.

Original change's description:
> Revert "Remove Python 2 support for PRESUBMIT.py"
>
> This reverts commit 8454fc2458.
>
> Reason for revert: post submit hooks failing
> https://crbug.com/1422416
>
> Original change's description:
> > 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>
>
> Bug: 1207012
> Bug: 1422416
> Change-Id: Iaf3102e63ec3c698d0258fac5746dbd92c30edbb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317176
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Bug: 1207012
Bug: 1422416
Change-Id: I9521095989c708188fca0251fa13881e086b1395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4516015
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago