We no longer need it to bridge path differences between buildbot and
LUCI, and it shouldn't be in use downstream now either.
R=machenbach@chromium.org, martiniss@chromium.org, tandrii@chromium.org, yiwzhang@google.com
Bug: 1015181
Change-Id: Iaba2100653ae9f06799d1d510bef993f7f710dc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2220171
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
This is similar in spirit to the helper flags in git subcommands, e.g.
try `git branch --git-completion-helper`. It provides a list of long
flags that the subcommands support, without repeating it manually in the
completion script. Note that this special flag is not returned in help,
so there is no noise.
To see the result, source the script, then `git cl upload --<TAB>`.
Change-Id: I82e280ceac5178b0e5fa52611b9a4125e6943337
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2209926
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
When source repo is a 'shallow clone', `.git/shallow` is not linked to
the new workdir. Which makes running git command fails in new workdir.
Change-Id: I81d38b7b2cccc482711dcc1dd02ea06fbd01a56d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211635
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Richard He <linyhe@microsoft.com>
Update git checkout before updating the tools.
If the scripts to update the tools are broken in the current revision,
this will allow us to get a new, hopefully working, revision instead of
leaving us stuck on a broken one.
We already do this for Linux.
Change-Id: I31856ebbd659d5360ad705dc39e5856b4140a19f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2208625
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of d3affaa624
Original change's description:
> Use OS level locking in git_cache.py
>
> Without OS level locking it's possible to leave "lock" files on disk
> which will prevent next run to acquire those locks. This can easily
> happen if SIGKIL is issued.
>
> R=apolito@google.com, ehmaldonado@chromium.org
>
> Bug: 1049610
> Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1049610
Change-Id: I58e65a10f7c779e0de1121ba7167c694996e390c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211189
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This reverts commit d3affaa624.
Reason for revert: no attribute ignore_lock
Original change's description:
> Use OS level locking in git_cache.py
>
> Without OS level locking it's possible to leave "lock" files on disk
> which will prevent next run to acquire those locks. This can easily
> happen if SIGKIL is issued.
>
> R=apolito@google.com, ehmaldonado@chromium.org
>
> Bug: 1049610
> Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
TBR=iannucci@chromium.org,ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
Change-Id: Iecc963e0a99d7f59f3f8801e529839346f9fbaf3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1049610
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211186
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* Call `os.path.normpath()` prior to comparing file paths
* Run Python files with `vpython`
* Pass `shell=True` for Windows commands, so that the PATH variable is
defined: https://stackoverflow.com/a/32799942
* While here, clean up similar call sites to drop an unnecessary cast.
Fixed: 1081763
Change-Id: I8096b3ad14a4675036a579fab537af1d94f12725
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2203422
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Ilya Sherman <isherman@chromium.org>
Without OS level locking it's possible to leave "lock" files on disk
which will prevent next run to acquire those locks. This can easily
happen if SIGKIL is issued.
R=apolito@google.com, ehmaldonado@chromium.org
Bug: 1049610
Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
The commands come from the output of git cl -h, which then goes through
an sed filter, matching on the ANSI escape sequence for green and reset.
This ends up having extra spaces, since the output aligns the
subcommands based on the longest subcommand. For shorter commands like
archive, it becomes "archive ". So, tweak the sed regex to only
capture the part without the whitespaces.
Change-Id: I80a84f142520478547895f85def68331575fdd72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2209582
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
__git_cl_all_commands is a variable, so it should use the variable
parameter, ${}, not a command substitution $().
Change-Id: I81fc2c73afd85cc1f737af00fbc294d933145e22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2205456
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
We should fail when we fail to update depot_tools instead of continuing
the execution silently. Otherwise, developers might get stuck on a bad
depot_tools revision without knowing.
Change-Id: I0431a24a28a77aca8c66352939a0252c458b3e9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2208616
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Also update copywrite header to conform to expectations.
BUG=chromium:1082354
TEST=locally, can upload commit with this fix
Change-Id: I5527cf9cc58fbab94f777b82008a422a3190f539
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2199884
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
It's possible to add commit objects to the tree, and this can cause
some confusion for git's tools - if this happens to overlap with an
actual folder or a gclient-imported repo, the tree will be dirty.
This change finds this issue by scanning the tree and looking for a
commit object there.
Bug: 869594
Change-Id: Ia1f1fb22ab8f7ac1eed7b32dedad5c1296b1d67b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1842637
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Derek Morris <demorri@microsoft.com>
File marker '.dirty_bot_checkout' indicates that bot_update checkout has
started. Such marker is removed on successful checkout.
If such marker is present before creation, it means previous run wasn't
successful and may have left workspace in a bad state. In that case,
delete working directory and continue with a clean checkout.
R=apolito@google.com, ehmaldonado@chromium.org
Bug: 1074260
Change-Id: Ic089eedc26f7c269d5342fae366899571d8f8d41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2186273
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
__git_cl_all_commands is used to cache the result of
__git_cl_commands(), but the actual code wasn't using it and was calling
the function everytime instead.
Change-Id: Ia2ce32b7de2812349808ec9aceeacf5adf463700
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2190337
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
If a local branch tracks removed remote tracking branch (e.g. foo) and
remote has a branch that starts with such name (e.g. foo/bar), git fetch
will fail. --prune flag removes any remote-tracking branches that no
longer exist.
R=apolito@google.com, ehmaldonado@chromium.org
Bug: 1079483
Change-Id: I9bc31bf961d52a86b6fa2342249971b99a003666
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2190341
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>