Commit Graph

12 Commits (main)

Author SHA1 Message Date
Yiwei Zhang f37d3b325f fail gracefully if git find-releases is called in cog
Bug: 339231299
Change-Id: I70e02cf053bae635d3db007fc9ef3aa534e6c749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5539650
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
10 months 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
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
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
Josip Sokcevic 4de5deacd4 Explicitly run everything with python3
R=aravindvasudev@google.com, gavinmak@google.com

Change-Id: Iaa5e960c6226dea3a0814c7cb778d952eafb1502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525960
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 1850bf6d17 Add unit tests for git_find_releases
R=ehmaldonado@chromium.org

Change-Id: Ib11ada368fda13bbef62c8be26ddb9c78a528a92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2107839
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Edward Lesmes 98eda3f3e4 Revert "depot_tools: Run Python scripts using vpython (Part 1)"
This reverts commit d6186f9936.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> depot_tools: Run Python scripts using vpython (Part 1)
> 
> Tbr: iannucci@chromium.org
> Bug: 984182
> Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

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

Change-Id: I7686985852608d0703bcbbab137df1ce82b29723
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749853
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur d6186f9936 depot_tools: Run Python scripts using vpython (Part 1)
Tbr: iannucci@chromium.org
Bug: 984182
Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Raul Tambre 80ee78e7fa Convert print statements to Python 3 style
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
6 years ago
scottmg@chromium.org b62f675439 find-releases: handle untagged merges
At the moment, this doesn't work too well for something that was just merged to
45.

[(b912ace...)]scottmg@scottmg:/work/cr/src$ git find-releases 55b4c95889d6a72e52bc72702580a62f04f35777
commit 55b4c95889d6a72e52bc72702580a62f04f35777 was:
  initially in 47.0.2501.0
  merged to undefined (as de54b58d404a0cdf01639ae7260ef10bbb843ed9)
  merged to 46.0.2490.19 (as b4ba1071baaabc92cb5a2ca89e238c478eca0075)

("undefined" being the problem). This is because:

[(b912ace...)]scottmg@scottmg:/work/cr/src$ git name-rev --tags de54b58d404a0cdf01639ae7260ef10bbb843ed9
de54b58d404a0cdf01639ae7260ef10bbb843ed9 undefined

But,

[(b912ace...)]scottmg@scottmg:/work/cr/src$ cat .git/refs/remotes/branch-heads/2454
de54b58d404a0cdf01639ae7260ef10bbb843ed9

So, if name-rev --tags says it's not yet tagged, rather than just printing
'undefined', at least say which branch it was merged to. As in:

[(b912ace...)]scottmg@scottmg:/work/cr/src$ git find-releases 55b4c95889d6a72e52bc72702580a62f04f35777
commit 55b4c95889d6a72e52bc72702580a62f04f35777 was:
  initially in 47.0.2501.0
  merged to branch-heads/2454 [untagged] (as de54b58d404a0cdf01639ae7260ef10bbb843ed9)
  merged to 46.0.2490.19 (as b4ba1071baaabc92cb5a2ca89e238c478eca0075)


R=dpranke@chromium.org,primiano@chromium.org

Review URL: https://codereview.chromium.org/1325233005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296621 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
scottmg@chromium.org f4ddadcf25 Add new tool, git find-releases
Finds the release(s) for a given change.

Relies on using "git cherry-pick -x" per
http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-drover.html
so that the merge commit message contains the original commit.

Example:

d:\src\cr3\src>git show -s 53cc88da9a258bc4a34c4bff50025ee044c2e64d
commit 53cc88da9a258bc4a34c4bff50025ee044c2e64d
Author: grt <grt@chromium.org>
Date:   Tue Jun 2 10:33:09 2015 -0700

    Beacons for tracking default browser status.

    BUG=488247
    R=gab@chromium.org,wfh@chromium.org

    Review URL: https://codereview.chromium.org/1146843003

    Cr-Commit-Position: refs/heads/master@{#332423}


"Now, where did that ship?"


d:\src\cr3\src>git find-releases 53cc88da9a258bc4a34c4bff50025ee044c2e64d
commit 53cc88da9a258bc4a34c4bff50025ee044c2e64d was:
  initially in 45.0.2421.0
  merged to 43.0.2357.126 (as 8a5ccc0e0ad6b2237b2fcfffcb0ab24fe97bc77b)
  merged to 44.0.2403.39 (as d5d165943a88e51a64fd9e2fbcc781e4aaee270f)

Review URL: https://codereview.chromium.org/1332473003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296604 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago