This is no longer supported to make the move to Python 3 easier.
Only some very old/weird user configurations may have this, so this provides a clear actionable error message.
Bug: 942522
Change-Id: I88106089c53d84b19c4f77b7e60fe251082122d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1539957
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
The previous git-nav-upstream fix used the current branch name, and
stored the upstream move relative to that branch (in the reflog), e.g
nav-upstream from branch foo to origin/master would should foo@{u}.
This unfortunately breaks if the branch is then deleted, so now we
calculate the upstream branch before checking it out, by passing
"@{u}" rather than HEAD to rev-parse.
Change-Id: I14a2eb8493d63e8386e988fd68b8a3125f19ce2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536070
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
connect(2) says stream sockets may only succeed to connect once. This means
if the call to sock.connect() fails it will continue failing for the
entirety of the wait loop, and we will fail to wait for a port to bind even
when it eventually becomes available.
Make sure we create a new socket every time we are about to try to connect
to it.
Change-Id: I16d7dbea3590c5bf7f7240bdefcc5ec0bcd1edb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528291
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Running "git cl issue -r invalid_input" will now produce an error
message and continue, instead of crashing with a stacktrace.
Change-Id: I17626a513df904a1a3ff725ec7a17e8541db6bf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1538978
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
This caused a bit of confusion for a customer who thought that they were
forbidden from passing Path objects in cmd.
R=tandrii@chromium.org
Change-Id: I352a6d5be75f48dcc0c8a8c92d6921359585ed48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536493
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
When an exception occurs in CheckCallAndFilter the push_returncode variable is used in the finally block without being initialized.
Traceback (most recent call last):
File "C:\Google\depot_tools\metrics.py", line 266, in print_notice_and_exit
yield
File "C:\Google\depot_tools\git_cl.py", line 5647, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\Google\depot_tools\git_cl.py", line 5629, in main
return dispatcher.execute(OptionParser(), argv)
File "C:\Google\depot_tools\subcommand.py", line 252, in execute
return command(parser, args[1:])
File "C:\Google\depot_tools\git_cl.py", line 4641, in CMDupload
return cl.CMDUpload(options, args, orig_args)
File "C:\Google\depot_tools\git_cl.py", line 1623, in CMDUpload
ret = self.CMDUploadChange(options, git_diff_args, custom_cl_base, change)
File "C:\Google\depot_tools\git_cl.py", line 2746, in CMDUploadChange
'exit_code': push_returncode,
UnboundLocalError: local variable 'push_returncode' referenced before assignment
Change-Id: Ife0e5226aa7e6127e8a508adb747f2c653ed8351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536033
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
For instance, if the bug-prefix is set to "b/", git cl upload will offer a
line with "Bug: b/", however it won't get stripped away if it's left blank,
unlike the default "Bug:" line. This change fixes that inconsistency by
also taking the bug-prefix into account when stripping.
Change-Id: Ib6e4d18c1ff52ec77cd1422be15b1e6920332238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528972
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jonas Termansen <sortie@google.com>
Since python2 tempfile does not have TemporaryDirectory, we need to either use temporary_directory in gclient_utils or implement it by ourselves. If we chose latter, we also need to implement rmtree for Windows. Considering that, I suppose using gclient_utils should be much easier.
Bug: 939959
Change-Id: Ife21a2bc297ac61a4c1940b06df937c293961ae7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524815
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Auto-Submit: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
I just made a bunch of branches disappear from `git map-branches` by
creating a big cycle (none of them were a root, thus none was listed at
all). This CL makes `git map-branches` check for such cycles and report
them as warnings.
R=iannucci@chromium.org
Change-Id: I723b327282a1c90bc9da5438777653e48f8bfd1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528985
Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Using just @{u} to navigate upstream breaks navigating back down when
the upstream reaches a non-local branch, e.g. origin/master. This is
because git branch walks the reflog for detached heads, and sees @{u}
instead of e.g. origin/master, and so tries to calculate HEAD@{u}
which fails. See also the message send to the git mailing list:
https://public-inbox.org/git/CAGRskv__Qe-F-grBtq5v-uhHE+BQAcAcOQtX-GKB+MNOrxs0hQ@mail.gmail.com/
This patch works around this by manually specifying the branch from
which we are calculating upstream, e.g. for branch foo we do
git checkout foo@{u} instead of just git checkout @{u}. This ensures
that the reflog has a valid entry (albeit still a relative one).
Change-Id: I339d4e4288a1e104b9d7d3d568c45b2b156f0689
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1534217
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Writing to ninjalog.cfg comes with the risk of failure (Ctrl+C at the
wrong time) which can lead to an empty or corrupted file. This will
cause errors on subsequent builds when loading the config file, and
will lose the users opt-in/out settings.
This change ensures that the config file is only written when something
has changed, thus essentially avoiding the risk.
Bug: 941810
Change-Id: If266f07536569c9ac91ee37c28797c8b2ccc6fdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1522291
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
This reverts commit 2d29261e94.
Reason for revert: Both jbudorick and I asked you not to land this today :(.
Original change's description:
> Remove exception for relative CIPD
>
> This seems to no longer be necessary, as relative paths 'just work' for
> CIPD deps now.
>
> Change-Id: I3843548dc74d29af90e0c402f0459dbe60934423
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1529132
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: John Budorick <jbudorick@chromium.org>
> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
TBR=dpranke@chromium.org,jbudorick@chromium.org,btolsch@chromium.org
Change-Id: I1d9a771ef34dae0dec15499d7cf28e4ba5daf2ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1531193
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
This seems to no longer be necessary, as relative paths 'just work' for
CIPD deps now.
Change-Id: I3843548dc74d29af90e0c402f0459dbe60934423
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1529132
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
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>
Needed by modules using DIA SDK, which is located in "[windows_sdk]/DIA SDK",
not under "[windows_sdk]/win_sdk".
Change-Id: I1ca42a38ef8d9d1cbfde5e63e786b7d792504f3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1526453
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Veranika Liaukevich <veranika@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Instead of creating an empty dict and setting all the required git variables
there, add those variables to os.environ so that we do not drop other
required variables -- in my case, git was not in /usr/bin so invoking 'git
commit' in _add_schema_commit fails with "no such file or directory".
Change-Id: I8c9b14e1f534efc8f40d21b312a5396b2f65f4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528290
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
It breaks gclient for some users depending on locale settings (see bug).
The feature just doesn't seem worth the complexity.
Bug: 934279
Change-Id: I2c6e2b77ab764381db9f2c4e63ff8a84526769bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1520646
Reviewed-by: Elliott Friedman <friedman@chromium.org>
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
The function we use with gclient_utils has moved to gclient_paths.
However, I am not sure gclient_utils is used by others or not.
Additional change:
- sorted testMembersChanged members for ease of understanding what is
different.
Bug: 939959
Change-Id: I8b822e26afc73b39d2a33c5e07779c9c14cbd394
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1521850
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@chromium.org>