Commit Graph

80 Commits (main)

Author SHA1 Message Date
Yiwei Zhang aa89e07e15 fail if fetch command is called in Cog
Bug: 345486495
Change-Id: I858a4041b54049cc52cf1a15f0aed461f3ddf985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5606279
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
9 months ago
Gavin Mak b808b1bcdd Use shlex instead of pipes
Importing pipes gets a DeprecationWarning. shlex.quote is equivalent to
pipes.quote. Use that instead.

Bug: 1522874
Change-Id: I18b8598f2e961d58ba71d886921bda9d9ad956ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5243707
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
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
Josip Sokcevic 88cc0b8ca8 Remove old Cog detection
This is no longer needed.

R=aravindvasudev@google.com

Change-Id: Ic1b2bbf0f00ca9d288c21fa1623c4ada80d59644
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5014581
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
1 year ago
Yiwei Zhang 23c4defd8d fetch: stop setting submodules config as we are not using it at all
R=sokcevic

Bug: 1496925
Change-Id: I448fb1f49b225d1a5f60103dbbcacaea2c69bd9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4995365
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Gavin Mak f936d540e1 Remove __future__ imports
All __future__ imports (unicode_literals, print_function) are already
mandatory in py3. Also remove an outdated py2 comment in
presubmit_canned_checks.py

Bug: 1475402
Change-Id: I27cf6a8268f6dd1081f22af782c4c29a975376ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4867135
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year 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 512f3cb37e Drop py2 support in various files
python3 is the only supported version of python in depot_tools.
Remove py2 support from files including:
  * cpplint.py
  * subprocess2.py
  * many tests and testing_support files

Bug: 1475402
Change-Id: I67a98188bc13c4dc119e6158a37bd236bfd6ea70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4824474
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
2 years ago
Aravind Vasudevan ed935cf29b Remove deadcode from depot_tools scripts
Removing some deadcode from depot_tools scripts. More follow-up CLs will
be made after this to remove more dead code.

R=sokcevic,gavinmak

Change-Id: Iad20e9e1737e49c1370248d32c6317cf2be63de4
Bug: 1475776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811216
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Josip Sokcevic 2c3875ea1c [fetch] Set diff.ignoreSubmodules to dirty
none is too slow for chromium/src (4x), and all doesn't work well with
git submodules.

R=jojwang

Bug: 1470195
Change-Id: I8fd4e27e68ff36b14c9f531a1f90b8d76b8f55d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4802510
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Thiago Perrotta 512dfd676b fetch: make --no-history and --no-hooks switches consistent
Before this commit, the following switches exist:

- --nohooks
- --no-history

They are not consistent. This commit makes the following switches
available:

- --nohooks, --no-hooks
- --nohistory, --no-history

Bug: None
Change-Id: Iaea2357c05e3dc69e3fac0fb9d823db903d811bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3904446
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Joanna Wang b415544db4 Add cog/ cwd for fetch.
Bug: 1354709, b/242209562

Change-Id: I48b5575c7a4b8855a8b1f95ced24acadaea39a59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3865737
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Aravind Vasudevan 810598d1f3 Add protocol_override entry to .gclient
The meta quest browser has an issue with the initial design where the all the dependencies within the same tree are overridden with the solution URL's scheme. This fix updates fetch to add a .gclient entry instead of implicitly overriding the URL's scheme.

Bug: 1336027
Change-Id: Iabe5b9017f6eb9e682a0c721f43dd5f347ffcbfb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3703942
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Aravind Vasudevan 14e6d235f2 Default fetch to sso:// within cog
This CL makes fetch default to sso:// within the cog env. It also adds a helper within gclient_scm to check if the env is cog.

Bug: chrome-operations:170
Change-Id: I8c35348653406549fadbd08df3d9991bb24ca776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3670721
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Aravind Vasudevan 5965d3e6fb Reland "Update fetch protocol using --protocol-override flag"
This is a reland of commit 6817010e83

Additional Changes:
This reland fixes https://crbug.com/1330995 by stopping gclient from accidentally updating the scheme when one is not present.

Original change's description:
> Update fetch protocol using --protocol-override flag
>
> This CL updates gclient sync to use the protocol of the URL specified in the solutions for cloning all the child dependencies of it.
>
> Bug: chrome-operations:170
> Change-Id: I33588059788b677fbae8c3b434100af5c7979a67
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3631600
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1330995
Change-Id: I1447a5e884e41d671d8556c35193f1635f2f6936
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3684112
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Aravind Vasudevan fe3a70a926 Revert "Update fetch protocol using --protocol-override flag"
This reverts commit 6817010e83.

Reason for revert: Breaks gclient sync for flutter

Original change's description:
> Update fetch protocol using --protocol-override flag
>
> This CL updates gclient sync to use the protocol of the URL specified in the solutions for cloning all the child dependencies of it.
>
> Bug: chrome-operations:170
> Change-Id: I33588059788b677fbae8c3b434100af5c7979a67
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3631600
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: chrome-operations:170
Change-Id: I76a49030f48fa266eeea336307e7153b22ded4e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3684110
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
3 years ago
Aravind Vasudevan 6817010e83 Update fetch protocol using --protocol-override flag
This CL updates gclient sync to use the protocol of the URL specified in the solutions for cloning all the child dependencies of it.

Bug: chrome-operations:170
Change-Id: I33588059788b677fbae8c3b434100af5c7979a67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3631600
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Aravind Vasudevan fb8cf9cc78 Add --protocol-override to fetch.py
This CL adds a non-functional `--protocol` flag to fetch.py. This will be used in the follow-up CL to update fetching protocol.

Bug: 1322156
Change-Id: I7eeebb9993face20bb671d6942ee23fd04802d8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3609453
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 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 075cd76fe6 Update argument parsing to use argparse
This CL updates argument parsing mechanism from using a custom implementation + optparse to argparse. It is intended to clear tech debt for future changes.

Change-Id: I06ba5d3c532638a7970be960e02ebbafbea9dcb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3541479
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Jamie Madill 9e3b7a973d Add fetch hook for ANGLE.
Bug: angleproject:7018
Change-Id: I0e685c81a43d247b4f1a0dd93850b30b829ef264
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3461421
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
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
Milad Farazmand e2686734ac Make fetch compatible with py 3.5
Running `fetch v8` with Python 3.5 produces the following error:
TypeError: the JSON object must be str, not 'bytes'

Adding `.decode("utf-8")` makes it compatible with both versions.

Change-Id: Ib0699b61b24f191559c30f1e7ca8d2c919803d03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2154108
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Josip Sokcevic 06c8bce148 Add unit tests for fetch.py
R=ehmaldonado@chromium.org

Change-Id: I298d5f962e03520a93be1a7e32943934f1bde0c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2101809
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Edward Lemur 5c869191c1 Reland "depot_tools: Use vpython to execute fetch."
This is a reland of 028367fe4a
Should be good to go
https://bugs.chromium.org/p/chromium/issues/detail?id=993053#c36

Original change's description:
> depot_tools: Use vpython to execute fetch.
>
> Bug: 1002153
> Change-Id: I11286bebc23bedada239d6ddb8ebb86207a41485
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1815707
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>

Bug: 1002153
Change-Id: I20dbec88a030e0de201eaac88147e83028505102
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854750
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes 69d781151b Revert "Reland "depot_tools: Use vpython to execute fetch.""
This reverts commit b37784118c.

Reason for revert: <INSERT REASONING HERE>
Skia still has problems

Original change's description:
> Reland "depot_tools: Use vpython to execute fetch."
> 
> This is a reland of 028367fe4a
> 
> Should work on Skia after https://skia-review.googlesource.com/c/skia/+/244116
> 
> Original change's description:
> > depot_tools: Use vpython to execute fetch.
> >
> > Bug: 1002153
> > Change-Id: I11286bebc23bedada239d6ddb8ebb86207a41485
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1815707
> > Reviewed-by: Anthony Polito <apolito@google.com>
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> > Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
> 
> Bug: 1002153
> Change-Id: Ifdde3c4a817ab6ca222c82c5448d630e85bf2a4b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1827719
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=ehmaldonado@chromium.org,jcgregorio@chromium.org,apolito@google.com

Change-Id: I1963c5bccf36692209dfe10aa30d77650e40c6f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1002153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1829971
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur b37784118c Reland "depot_tools: Use vpython to execute fetch."
This is a reland of 028367fe4a

Should work on Skia after https://skia-review.googlesource.com/c/skia/+/244116

Original change's description:
> depot_tools: Use vpython to execute fetch.
>
> Bug: 1002153
> Change-Id: I11286bebc23bedada239d6ddb8ebb86207a41485
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1815707
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>

Bug: 1002153
Change-Id: Ifdde3c4a817ab6ca222c82c5448d630e85bf2a4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1827719
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lesmes d48cbf9345 Revert "depot_tools: Use vpython to execute fetch."
This reverts commit 028367fe4a.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> depot_tools: Use vpython to execute fetch.
> 
> Bug: 1002153
> Change-Id: I11286bebc23bedada239d6ddb8ebb86207a41485
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1815707
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>

TBR=tandrii@google.com,ehmaldonado@chromium.org,apolito@google.com

Change-Id: I0924e77a3862b8a75195db7fe719286e1cb3ac7e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1002153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1824217
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 028367fe4a depot_tools: Use vpython to execute fetch.
Bug: 1002153
Change-Id: I11286bebc23bedada239d6ddb8ebb86207a41485
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1815707
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lesmes 7149d23621 Revert "depot_tools: Run Python scripts using vpython (Part 2)"
This reverts commit 3c814957ee.

Reason for revert: <INSERT REASONING HERE>

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

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

Change-Id: Ic683543a04b45f733b48d6c43453fc8dff511d09
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749852
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 3c814957ee depot_tools: Run Python scripts using vpython (Part 2)
Tbr: iannucci@chromium.org
Bug: 984182
Change-Id: I2e8469f8ee0acd6a54109697d5a6b76faf24fa42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748590
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
James Darpinian f994d87e56 Revert "Reland "depot_tools: Move six to depot_tools' .vpython""
This reverts commit d52b306f84.

Reason for revert: Broke ANGLE CQ with "ImportError: No module named six"
Example: https://ci.chromium.org/p/angle/builders/try/mac-dbg/6758

Original change's description:
> Reland "depot_tools: Move six to depot_tools' .vpython"
> 
> This is a reland of 3a98df0bdd
> 
> Original change's description:
> > depot_tools: Move six to depot_tools' .vpython
> > 
> > Bug: 984182
> > Change-Id: I34a242c8607624beb0f06a27c563e413dec99790
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717492
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> > Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> > Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> > Reviewed-by: Michael Moss <mmoss@chromium.org>
> 
> Bug: 984182
> Change-Id: Ibf7034201e65a18f833cf1e7432f81a903a99aae
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1732880
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

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

Change-Id: Id4488249b607441df9f00aa51f4a1f2bc4ad5cfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1739582
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
6 years ago
Edward Lemur d52b306f84 Reland "depot_tools: Move six to depot_tools' .vpython"
This is a reland of 3a98df0bdd

Original change's description:
> depot_tools: Move six to depot_tools' .vpython
> 
> Bug: 984182
> Change-Id: I34a242c8607624beb0f06a27c563e413dec99790
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717492
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Reviewed-by: Michael Moss <mmoss@chromium.org>

Bug: 984182
Change-Id: Ibf7034201e65a18f833cf1e7432f81a903a99aae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1732880
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lesmes 365720e237 Revert "depot_tools: Move six to depot_tools' .vpython"
This reverts commit 3a98df0bdd.

Reason for revert:
Can't roll into skia and build_internal

Original change's description:
> depot_tools: Move six to depot_tools' .vpython
> 
> Bug: 984182
> Change-Id: I34a242c8607624beb0f06a27c563e413dec99790
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717492
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Reviewed-by: Michael Moss <mmoss@chromium.org>

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

Change-Id: I51e502e6f7633a6f26898f1ecbcd86ccf9c7c123
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1718996
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 3a98df0bdd depot_tools: Move six to depot_tools' .vpython
Bug: 984182
Change-Id: I34a242c8607624beb0f06a27c563e413dec99790
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717492
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
6 years ago
Raul Tambre 43271f94de fetch: Decode gclient output if returning stdout
In Python 3 the output of a subprocess is bytes, so they need to be decoded to be used as a string.

This previously caused the following error if there was an existing checkout during a fetch:
Traceback (most recent call last):
  File "C:\Google\depot_tools\\fetch.py", line 318, in <module>
    sys.exit(main())
  File "C:\Google\depot_tools\\fetch.py", line 313, in main
    return run(options, spec, root)
  File "C:\Google\depot_tools\\fetch.py", line 299, in run
    if not options.force and checkout.exists():
  File "C:\Google\depot_tools\\fetch.py", line 98, in exists
    return (os.path.exists(os.path.join(gclient_root, b'.gclient')) or
  File "C:\Program Files\Python38\lib\ntpath.py", line 109, in join
    genericpath._check_arg_types('join', path, *paths)
  File "C:\Program Files\Python38\lib\genericpath.py", line 151, in _check_arg_types
    raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components

Bug: 939847
Change-Id: Ibf5b4923268595ba439586d688894f92696ecbb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701403
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
6 years ago
Elly Fong-Jones 7b2943927c depot_tools: bail out if $PATH contains tildes
Bash and its descendants allow having $PATH entries containing literal tildes,
like:
  ...:~/depot_tools:...
If the user has their shell configured this way, their shell will be able to
invoke `fetch` and other depot_tools commands, but depot_tools will not in turn
be able to invoke subcommands via popen because popen does not have this
bash-specific behavior when not in shell mode.

This change has gclient detect this configuration problem and error out with a
descriptive error message. Not doing so leads to a puzzling condition where
gclient complains about being unable to find a program that (from the user's
perspective) is in their $PATH and invokable interactively.

It also has 'fetch' suppress its own failure stack trace if it runs gclient and
gclient fails; the 'fetch' stack trace pushes the messages from gclient (which
are actually diagnostic) off the screen.

Bug: chromium:952865
Change-Id: Ibba4d2fccee405aa68392ce141493f1de21ec018
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1573204
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
6 years ago
Raul Tambre c2f74c1698 Make fetch compatible with Python 3
The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 939847
Change-Id: Icada60c5b2cf351d62aead26b7364fcef2c2a3e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524486
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
6 years ago
Torne (Richard Coles) 08ca04b2b2 Don't fetch tags when using --no-history.
After the initial gclient sync, "fetch --no-history" was adding a
fetchspec to the config for the main repository that causes all tags to
be downloaded in future. This means that after fetching a repository
with no history, the very next git pull (or other remote update
operation) will download all the tags, including all the history
referred to by those tags, leaving you with an almost-complete checkout
of the top-level repository that takes up much more space.

Fix this by skipping the "git config" command that requests the tags
when using no-history.

Change-Id: Ia31baa6a90df014ebc1e8c2ed6e05de3ad27d415
Reviewed-on: https://chromium-review.googlesource.com/909653
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
7 years ago
Edward Lemur 7a4ced2773 Report progress of gclient sync during fetch.
Add an option to not store stdout when running commands unless it's needed.

R=agable@chromium.org

Bug: 722686
Change-Id: I402c83767097d53e588ba3e8bca89291712a572f
Reviewed-on: https://chromium-review.googlesource.com/888584
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Aaron Gable bd95f41abd Fix fetch --dry-run to not invoke git
This was broken by 209a681f9c,
which replaced self.run() with git_common.run(), thus
bypassing self.run()'s dry_run check.

Bug: 788562
Change-Id: I9964c169b0ff56778c4660acab7ef7c010e37a36
Reviewed-on: https://chromium-review.googlesource.com/797611
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Dan Jacques 209a681f9c [git] Remove hard-coded "depot_tools" Git.
Several tools, including the "git" recipe module, hard-code a
checkout-relative "git.bat" path. Git is a feature that is provided by
the system, both to tooling and recipes:

1) For users, "depot_tools" must be on PATH, and during setup it will
   have installed "git.bat", ensuring that Git tooling is available in
   PATH.
2) For bots, the system is responsible for providing "git.bat" on PATH.
   This is typically done at "/b/depot_tools/git.bat", which is sync'd
   through the "update_scripts" step.

By formally treating Git as a system resource, we absolve Windows bots
and users from manually installing a depot_tools-local Git, bringing
them in line with other platforms.

BUG=chromium:590806
TEST=local

Change-Id: I93e89855cdd330a2ba7a8cfb8117a1789d1ab54e
Reviewed-on: https://chromium-review.googlesource.com/568694
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
8 years ago
Dr Alex Gouaillard e1dd46f06c ENH: pass cache_dir arg through fetch, webrtc, and eventually chromium.
BUG=

Change-Id: I33aa83c36721059005b86fe8538560c302bbd4b5
Reviewed-on: https://chromium-review.googlesource.com/414692
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Henrik Kjellander <kjellander@chromium.org>
8 years ago
agable 7276228639 Remove git-svn support from fetch
R=iannucci@chromium.org
BUG=475320

Review-Url: https://codereview.chromium.org/2360873002
9 years ago
agable 3b9a5bb84f Delete git-auto-svn and its docs
We no longer support git-svn as a workflow.

R=iannucci@chromium.org
BUG=475320

Review-Url: https://codereview.chromium.org/2360143002
9 years ago
iannucci@chromium.org 78faf8b54e Fix depot_tools presubmit's local_rietveld script.
This was breaking presubmit because the linked gae_ts_mon subdir was absent.

R=andybons@chromium.org, dsansome@chromium.org, dnj@chromium.org
BUG=608490

Review-Url: https://codereview.chromium.org/1959193002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300511 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
luqui@chromium.org b371a1c852 Rename recipes/ to fetch_configs/
We are making depot_tools a proper (chromium) recipe package, which assumes
that recipes are located in recipes/.  So I need to move these other kinds of
recipes out of the way.

BUG=564920
R=dpranke@chromium.org, iannucci@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297837 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
thestig@chromium.org 37103c9c88 Sort the fetch recipe listing.
Review URL: https://codereview.chromium.org/1360493002

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