e.g. when specifying both '--revision src@<something>' and
'--revision <src_gerrit_repo>@<some_gerrit_ref>', gclient will sync to
'<some_gerrit_ref>' instead of '<something>'.
This is useful when specifying which gerrit change to patch, which
should take priority over other revision specifications.
Bug: chromium:643346
Change-Id: Ibc21ede355b56e4da966f38f144ce6f6f1743403
Reviewed-on: https://chromium-review.googlesource.com/949981
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Add a --output-json flag to gclient revinfo so is easier for other
programs to process its output.
Bug: None
Change-Id: Ic120e7a279f3ed537ead624ab9bfd1f141485487
Reviewed-on: https://chromium-review.googlesource.com/952206
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Add --path and --url options to show only the dependencies that match
one of the given paths or URLs.
Bug: None
Change-Id: I12c205545b7ce54b56abcd62f9bf1db229b4fd77
Reviewed-on: https://chromium-review.googlesource.com/951963
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
When hooks multiple cipd packages under same directory, gclient would
pop up error that same directory name appears multiple times in deps
section. This CL overrides verify_validity for CipdDependency to
support multiple packages hooked in same directory.
Bug:812386
Change-Id: Ia4f1fe0e3c8481c9b06c1d22b6e98d98e1e4c309
Reviewed-on: https://chromium-review.googlesource.com/920686
Commit-Queue: Shenghua Zhang <shenghuazhang@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
For now 'version' of packages only support string like 'version:27.0.5'.
It is helpful to support version to match vars value, e.g.
Var('tool_version'), especially useful when version numbers could be
modified via api. This change won't affect versions with string format.
Change-Id: I40b389b528f04712798b08f1455869cab2ec54c9
Reviewed-on: https://chromium-review.googlesource.com/935666
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Shenghua Zhang <shenghuazhang@chromium.org>
This CL adds target_cpu and target_cpu_only variables. The logic is:
* If target_cpu is defined in .gclient, use it. Otherwise, initialize it as an
empty list.
* If not target_cpu_only, add the host arch to the list too.
detect_host_arch.py is copied directly from the Chromium repo.
BUG=807986
R=dpranke
Change-Id: I27621cbc81ad6a844648525863b92ffdd3b1d03a
Reviewed-on: https://chromium-review.googlesource.com/902441
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Flattening currently ignores custom_vars, but it looks like that was
just an attempt to avoid including all the runtime-calculated values
(e.g. the host OS) in the flattened output, and not because there's any
real issue with supporting explicit overrides.
This is useful for changing default values in the flattened buildspecs
(e.g. to enable internal checkouts by default).
R=dpranke@google.com, iannucci@google.com
Bug: 570091,807318
Change-Id: I6d743f33cf7e3e202d5e68d21657f74f0e4c001b
Reviewed-on: https://chromium-review.googlesource.com/895927
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
This will allow us to show the progress when cloning a new repo when running
commands like gclient sync.
R=agable@chromium.org
Bug: 722686
Change-Id: I268cba343ea4c3c024292c9341d5009aa112b184
Reviewed-on: https://chromium-review.googlesource.com/890524
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
bot_update & gclient on bots instruct git cache locks
to be ignored, so there is no need to clean them up.
R=hinoka@chromium.org
Change-Id: I81c52cfcd44a42d13b641847439ac92053a7bc98
Reviewed-on: https://chromium-review.googlesource.com/791652
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
This will let progress show the name of the hook while it's running.
Change-Id: I14ef2a9b5fd2bc4d8d778f5402f78a5827ffbb08
Reviewed-on: https://chromium-review.googlesource.com/731469
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
When 'gclient recurse' is called from a unconfigured directory.
No functional change otherwise.
R=agable@chromium.org
Bug:774749
Change-Id: Ifb2b74c042ce31faf3e1287c5614739e58e9178c
Reviewed-on: https://chromium-review.googlesource.com/726419
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Previously, gclient would attempt to write an args file after
a dependency was checked out, but before any sub-dependencies
had been checked out. If the args file path pointed at something
inside a sub-dependency, this wouldn't work, because the directory
might not yet exist. This most obviously happened for buildspec
clobber builds.
The fix is to wait until after the sub-dependencies have been
checked out to write the file.
R=phajdan.jr@chromium.org, mmoss@chromium.org
BUG=773933
Change-Id: I0cf4564204f7dabd9f843dc7904db7050fcc0d23
Reviewed-on: https://chromium-review.googlesource.com/714644
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
These aren't in use, and the original problem they were
meant to solve has been solved at the gclient.py layer
using resource locking:
https://codereview.chromium.org/2049583003
Bug: 773008
Change-Id: I6609f39d7f15604e0bb3d742a41c4f9fec87a57a
Reviewed-on: https://chromium-review.googlesource.com/707728
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
Bug: 661382
Change-Id: Id50b2541132002452bc5d86bb013758e8be0f4b0
Reviewed-on: https://chromium-review.googlesource.com/697813
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
- provide structured output
- take deps_file fallback into account
Bug: 756474
Change-Id: Icb15eb9601b0aaf510300cf8992b067a25f6888a
Reviewed-on: https://chromium-review.googlesource.com/663258
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
This CL includes this as comments in flattened DEPS, as requested
on the bug. For automated processes using this, we should export
the data in machine-readable form outside of the DEPS file.
Bug: 756474, 570091
Change-Id: I78cd2105113f41d599e293e772e1f1ca42679f3c
Reviewed-on: https://chromium-review.googlesource.com/621726
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
We need to pass OS info to recursively called _flatten_dep.
Regular deps entries in OS-specific DEPS file recursed into
need to be marked as OS-specific in the flattened file.
Bug: 570091
Change-Id: If3055b84143d8a52d10d8753113893b5054b4d07
Reviewed-on: https://chromium-review.googlesource.com/621046
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
This fixes an issue where "--deps=all" syncs everything but ios.
R=dpranke@chromium.org, phajdan.jr@chromium.org
Change-Id: I413269c5026b2c04f0d34d9ca874057eb35e1076
Reviewed-on: https://chromium-review.googlesource.com/618802
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
Bug: 570091
Change-Id: I773b74b042233efa2a525f5f47e920468b7fea4a
Reviewed-on: https://chromium-review.googlesource.com/618930
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Consistently pin all dependencies - including deps_os and ones
with shortened shas.
We add --process-all-deps switch so that users can easily
tell gclient to check out all affected dependencies locally.
Bug: 570091
Change-Id: If68db98000c569ae35dd7d0a4b695eb80a589213
Reviewed-on: https://chromium-review.googlesource.com/617224
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
There are some usecases where it is simpler to pass path to the
cache by an environment variable or command-line argument
than to modify the gclient config file.
With this change:
* GCLIENT_CACHE_DIR environment variable overrides cache_dir variable
from .gclient file.
* --cache-dir argument moved from gclient config to all gclient
commands and overrides values from .gclient file and environment
variable.
R=dpranke@chromium.org
Bug:
Change-Id: Iae107f1d5f02a2eee1896d0d3108dc20a83d597f
Reviewed-on: https://chromium-review.googlesource.com/596089
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Daniel Jacques <dnj@chromium.org>
Commit-Queue: Aleksandr Derbenev <alex-ac@yandex-team.ru>
Otherwise it'd get stringified to "None" and make resulting DEPS invalid.
In theory we could properly serialize them to None,
but it's simpler to just skip them, since they do not affect resulting checkout.
Bug: 570091
Change-Id: Ica301e2d7e40ba4ed04527355d8f75a43456391c
Reviewed-on: https://chromium-review.googlesource.com/610150
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
This finally makes the code structure seem right as well: there's just
one method (_flatten_dep), with a simpler control flow.
Also added a regression test.
Bug: 570091
Change-Id: I22ac7a3af0429a7ffd874b4b1715c0f6c72e0006
Reviewed-on: https://chromium-review.googlesource.com/608241
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Nice side-effect of this change is simplifying the code.
Also added regression test coverage.
Bug: 570091
Change-Id: I470e9efc319632f997b02d210483988c17a7d3c8
Reviewed-on: https://chromium-review.googlesource.com/600369
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
- allow variables with same names as long as values are also the same
- allow recursedeps entries referencing deps_os entries
Bug: 570091
Change-Id: I4abbd255982368a0ee33e8f3de631f3d18adf6ab
Reviewed-on: https://chromium-review.googlesource.com/583649
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
This is part of preparation for gclient flatten, conditions,
and improving internal gclient workflows.
This also ensures variables have consistent values in the entire checkout,
unlike the current situation where different DEPS files can use different
values for the same variable.
We override instead of erroring out, since otherwise commonly used dependencies
such as buildtools wuld have to be rolled simultaneously in unrelated projects,
say v8 and native_client.
Another reason for overriding are possible future use cases such as is_chromium_build,
which could be set to false e.g. in v8, but chromium DEPS would override it to true.
Bug: 570091
Change-Id: If61322dd9a55e57729a4100d05ecb9c1e3ae8e38
Reviewed-on: https://chromium-review.googlesource.com/596310
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>