Commit Graph

1162 Commits (3b9212b7ee01b13d2f8fb9a41bc2639fd391df5c)

Author SHA1 Message Date
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
mark a. foltz bcb9577a46 [depot_tools] Update messages for git cl upload.
If a Gerrit issue has commits not available in the local branch,
git cl upload will tell the user to run git rebase-update.  That doesn't
actually merge the Gerrit commits into the local branch though, so the message
is misleading.

Bug: 1441209
Change-Id: Ib30377ac3a0d87e5fcfc491759b10c3268883159
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4507644
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
2 years ago
Lukasz Anforowicz 9696c7f3ff [rust] [depot_tools] Refer to a more specific rustfmt bug in a TODO.
Bug: 1440869
Change-Id: I1ac21bf23972da9e515315c6bffb9afac9641393
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4484184
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
2 years ago
Joanna Wang 1398e4fc69 Update stacked changes dogfood message.
Bug: 1441218
Change-Id: Ic82332d4ca1bda3049bb77daf90bf89aa8914577
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4495347
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang ddd8578dbe Enroll everyone in stacked changes dogfood.
Bug: b/265929888
Change-Id: Ib084e306a23a6159b8d5fe4b45bf9af731514665
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4482418
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Michael Achenbach b5cec8c867 Fix Python2 fallback in git-cl post-upload hooks
This fixes an uninitialized variable.

Bug: 1411979, 1435326
Change-Id: Ib28ed259238ff478e78e36b48e74eaf51617cd6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4457528
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic 34f62b4af7 Run post submit hooks on vpython3 if vpython is unavailable
If bot doesn't have vpython, run post submit hooks with vpython3.
presubmit_support already checks this too, and it will run those
presubmits regardless of USE_PYTHON3 variable.

Bug: 1411979
Change-Id: Id7edb8a10c39d625154dcc5a131becad3d3ebcbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4457567
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Brian Ryner 8d19d8641b Add newlines to info message so words aren't squashed together.
Change-Id: I909b38a4aaa40e9ea8b4d40cababa1274d21e145
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4414305
Auto-Submit: Brian Ryner <bryner@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang d3cbd40cf9 Enroll chromium/src in stacked changes dogfood.
Bug: b/265929888
Change-Id: I1c996c631042cf52449565932eba5040089e76ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4412254
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Arthur Milchior 801a975021 [depot tools] Remove `git cl issue --switch`
This was a duplicate of `git cl checkout`

Revert "[depot tools] Add `git cl issue --switch`"
Revert "[depot_tools] Use a function instead of reimplementing it."

This reverts commits 61ebd177ab and
7f9b0231c4.

Bug: 1428476
Change-Id: I54b70d7c7e98c847768cd980b337510fb91cdb20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4405816
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org>
2 years ago
Arthur Milchior 7f9b0231c4 [depot_tools] Use a function instead of reimplementing it.
It seems dubious that this function ever need to change. But it’s
safer to use this function just in case.

Bug: 1428476
Change-Id: I3c60e6be5c7dab6f003c209b47340e7573819e16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4403090
Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Arthur Milchior 61ebd177ab [depot tools] Add `git cl issue --switch`
This extra option to Issue number: None (None) allow to switch to the
branch associated to an issue iff there is a single one of those.

Fixed: 1428476
Change-Id: Id39792cffddcb0b08f1123e18f319256209267f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4381562
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org>
Auto-Submit: Arthur Milchior <arthurmilchior@chromium.org>
2 years ago
Joanna Wang 05b60349bd Add orig_parent to create change descriptions.
Bug: 1426333
Change-Id: I9a199d98aad7ca5133dfa85dd632ffc22f89e421
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4370432
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang c5b38329e6 Don't raise 'not a git repo' error in metrics collection.
Fixed: 1424809
Change-Id: I8f8b036a0ef1dd21a58d2af232e105b045e07f56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4343669
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang 3408652be0 Add push_options to dogfood stacked changes.
Bug: 1423539
Change-Id: If17ce0738878b67d6a267f3082e58ddcef788a4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4337901
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 892f2ceea5 Fix git_cl tests for DOGFOOD_STACKED_CHANGES=1
Bug: 1422684
Change-Id: I0c772951cdce8bbe0b03b0008d26e80adea593d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4337899
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Aravind Vasudevan a9a050c879 Update banned words flag
This change updates banned words flag from 'uploadvalidator~skip' to 'banned-words~skip'.

Bug: None
Change-Id: I2d544171d01e6f61415ba7df03b31e7111226342
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4327604
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Josip Sokcevic a9a7eecf37 Revert "Extract searching relevat files in utils function"
This reverts commit 512fd3bd85.

Reason for revert: breaks some presubmits
https://crbug.com/1421441

Original change's description:
> 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>

Bug: 1421441
Change-Id: I20e40f452a544a1188a258131a620e2afcd64f13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4328468
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic 48d8e90bd4 Revert "Reland "Remove Python 2 support for PRESUBMIT.py""
This reverts commit e9ece0f581.

Reason for revert: broke infra presubmits:
https://ci.chromium.org/p/infra/builders/try/infra-try-presubmit

Original change's description:
> Reland "Remove Python 2 support for PRESUBMIT.py"
>
> This is a reland of commit 8454fc2458
>
> 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
> Change-Id: If542cac21d8ec8704b28d03fd8407c5c2899ca2c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317177
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>

Bug: 1207012
Change-Id: Iebf76d9e2580761fc773791bac07439160503c98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4323198
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Josip Sokcevic e9ece0f581 Reland "Remove Python 2 support for PRESUBMIT.py"
This is a reland of commit 8454fc2458

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
Change-Id: If542cac21d8ec8704b28d03fd8407c5c2899ca2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317177
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic d4c6cbeb61 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>
2 years ago
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