Commit Graph

24 Commits (main)

Author SHA1 Message Date
Yiwei Zhang 718d2c81de fail gracefully if git map is called in cog
Bug: 339231299
Change-Id: Iba5519f7d9e9c18abfbae47866f6b91d821c54e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5539652
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: 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
Aravind Vasudevan c5f0cbb865 Use pylint 2.7 for depot_tools
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Josip Sokcevic 42c5bbbc96 Revert "Use pylint 2.7 for depot_tools"
This reverts commit 22bf605bb6.

Reason for revert: breaks gclient sync

Original change's description:
> Use pylint 2.7 for depot_tools
>
> This includes a few fixes for specific errors, and disables several new
> warnings introduced in this version, in order to allow for an incremental migration.
>
> Bug:1262286
> Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1262286
Change-Id: Ieb946073c7886c7bf056ce843a5a48e82becf7a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413672
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Aravind Vasudevan 22bf605bb6 Use pylint 2.7 for depot_tools
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Edward Lemur b800fde565 git-map: Refactor and add simple tests
Change-Id: I8fd0034f6a6d7623792620f92208b25961fa174e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1990142
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
Ran:
  vi $(git grep --name-only iteritems | grep -v third_party)
  vi $(git grep --name-only itervalues | grep -v third_party)
  vi $(git grep --name-only 'print ' | grep -v third_party)

and edited the files quickly with adhoc macros. Then ran in recipes/:
  ./recipes.py test train

There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.

Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
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
Aaron Gable 52e8abc30f git-map: use committer date instead of author date
TBR=iannucci@chromium.org

Change-Id: I07668787e4f26bc4809ea3c3a5331a259655d2da
Reviewed-on: https://chromium-review.googlesource.com/527295
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
anatoly techtonik c878ba6027 git map: Add -h option
Bug:

Change-Id: Ife7f4049062bc951e58d5c322b1fc7e39338fe79
Reviewed-on: https://chromium-review.googlesource.com/463246
Commit-Queue: anatoly techtonik <techtonik@gmail.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
8 years ago
agable 7aa2ddd81d Refactor git_common config and die
R=iannucci@chromium.org
BUG=376099

Review-Url: https://codereview.chromium.org/2075603002
9 years ago
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.

Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
iannucci@chromium.org 10fbe879aa Make marked merge base invalid when the upstream changes.
This should let the base marker transparently work with plain-old-git tools
which was the idea in the first place. Specifically `git branch -u` without a
corresponding rebase.

R=agable@chromium.org
BUG=373977

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@271112 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 6332b152c6 Make git_map properly update merge base markers.
R=agable@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@270572 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org cfa516f8a3 Fix colorization bug in git_map.
Previously BRIGHT+WHITE would wrap around to the asterisk on the next line.

R=agable@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@261783 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org a8378e2fdb Explicitly include root() in the git-map call to git-log.
This is in-place of --remotes. With repos like src.git that have alternate roots
this causes git-map to be faster (since it's not trying to display
origin/master).

R=agable@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259646 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org c050a5b2be Add a family of git-commands to assist with the management of multiple CLs/branches.
git-rebase-update - ensure all branches are up to date
git-new-branch - create branches
git-rename-branch - rename a branch while preserving parentage relationships
git-reparent-branch - change the parent of a branch, including rebasing it correctly onto that new parent.
git-squash-branch - collapse a branch into a single commit
git-upstream-diff - show the diff between the current branch and it's upstream branch
git-mark-merge-base - explicitly set what you want the above tools to consider the merge-base for the current branch.

R=agable@chromium.org, hinoka@chromium.org, stip@chromium.org, szager@chromium.org
BUG=261738

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259520 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org a112f03fcf Fix git_nav_downstream.py when origin/master is checked out.
Also fix missing copyright notices.

R=agable@chromium.org
BUG=261738

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256777 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 8bc9b5c101 Add git-map and git-map-branches to depot_tools.
git-map: Show your local repo's history in a pseudo-graphical format from the command line.

git-map-branches: Show the topology of all of your branches, and their upstream relationships.

git-nav-upstream: Navigate (checkout) to the upstream branch of the current branch.

git-nav-downstream: Navigate (checkout) to a downstream branch of the current branch. If there's more than one downstream branch, then present a menu to select which one you want.

R=agable@chromium.org, hinoka@chromium.org, stip@chromium.org, szager@chromium.org
BUG=

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

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