Commit Graph

104 Commits (418f021a0eddf7a207d8e5b68cccf0588c3a9724)

Author SHA1 Message Date
Joanna Wang 1a977bdc2d Update gclient cloning to work with cog.
Bug:1330629
Change-Id: I522255528e36d4806eada70c22afee1277a6778d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3668429
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
3 years ago
James Zern fdd89469d6 update stale codereview.chromium.org links
w/chromium-review.googlesource.com

Change-Id: I8f024d68a3b89ae530fc1ce2806b9b12b83ba7b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2585050
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: James Zern <jzern@google.com>
4 years ago
Ben Pastene d410c664e6 gclient: Preserve ANSI color codes when calling hooks.
If a hook prints error/warning output that's color-coded, gclient
will cause the coloring to be disabled since those hooks aren't
called directly from a terminal.

By emulating a terminal when launching subprocs from gclient, we can
convince them to keep the color escape codes.

LED builds with both //third_party/depot_tools rolled to this CL, as
well as depot_tools in the recipe bundle rolled to this CL:
linux: https://ci.chromium.org/swarming/task/4e40237985888310
mac: https://ci.chromium.org/swarming/task/4e4023ea0c829710
win: https://ci.chromium.org/swarming/task/4e4024612e03dc10

Bug: 1034063
Change-Id: I4150f66ef215ece06f4c32482dcd4ded14eb1bfe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2368435
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
5 years ago
Edward Lemur 1773f37de6 gclient_utils: Add temporary_file method.
Useful when passing information to a subcommand via a temporary file.

Bug: 1051631
Change-Id: I0b8deda921effd24a37109544e1e7ca22e00ba4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2068942
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur a81450253f depot_tools: Use mock from vpython (or unittest.mock) instead of third_party/mock
Change-Id: I3a188b34ae5f62649108afe08fe0e389a408c2ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1947933
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Edward Lemur 419c92f1bc gclient_utils: Make FileRead always return a Unicode string.
Previously, it returned bytes if the file did not contain valid Unicode data,
and a Unicode string otherwise.
It is confusing to reason about such a function, and no current caller needs
bytes data AFAICT, so make FileRead always return Unicode strings.

Bug: 1009814
Change-Id: I89dd1935e5d4fcaf9af71585b85bda6c47695950
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1880013
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur cb1eb48966 Reland "gclient_utils: buffer output as bytestrings in Annotated"
This is a reland of 5d284fdf48

Always convert the input to bytes and write to sys.stdout (in Python2)
and sys.stdout.buffer (in Python 3).

Original change's description:
> gclient_utils: buffer output as bytestrings in Annotated
>
> In Python 3 byestrings and normal strings can't be concatenated.
> To fix this we buffer as bytestrings in the Annotated wrapper.
> We can't decode to a string because the output might come byte-by-byte, so it doesn't work with Unicode characters like ✔.
>
> Also had to update gclient_test.py, where double-wrapping stdout with Annotated caused made output not work and include_zero=True working caused other unintended side-effects.
>
> Example error from "fetch chromium":
> Traceback (most recent call last):
>   File "C:\Google\depot_tools\gclient_scm.py", line 1045, in _Clone
>     self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
>   File "C:\Google\depot_tools\gclient_scm.py", line 1370, in _Run
>     gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
>   File "C:\Google\depot_tools\gclient_utils.py", line 583, in CheckCallAndFilter
>     show_header_if_necessary(needs_header, attempt)
>   File "C:\Google\depot_tools\gclient_utils.py", line 533, in show_header_if_necessary
>     stdout_write(header.encode())
>   File "C:\Google\depot_tools\gclient_utils.py", line 391, in write
>     obj[0] += out
> TypeError: can only concatenate str (not "bytes") to str
>
> Bug: 984182
> Change-Id: If7037d30e9faf524f2405258281f6e6cd0bcdcae
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1778745
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Raul Tambre <raul@tambre.ee>

Bug: 984182
Change-Id: Ifafb5e16a517c4c38dd4c9d5c6d4c3f994838bc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1845504
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Bob Haarman eeafa0eaec Revert "gclient_utils: buffer output as bytestrings in Annotated"
This reverts commit 5d284fdf48.

Reason for revert: breaks buildbots, crbug.com/1011982

Original change's description:
> gclient_utils: buffer output as bytestrings in Annotated
> 
> In Python 3 byestrings and normal strings can't be concatenated.
> To fix this we buffer as bytestrings in the Annotated wrapper.
> We can't decode to a string because the output might come byte-by-byte, so it doesn't work with Unicode characters like ✔.
> 
> Also had to update gclient_test.py, where double-wrapping stdout with Annotated caused made output not work and include_zero=True working caused other unintended side-effects.
> 
> Example error from "fetch chromium":
> Traceback (most recent call last):
>   File "C:\Google\depot_tools\gclient_scm.py", line 1045, in _Clone
>     self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
>   File "C:\Google\depot_tools\gclient_scm.py", line 1370, in _Run
>     gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
>   File "C:\Google\depot_tools\gclient_utils.py", line 583, in CheckCallAndFilter
>     show_header_if_necessary(needs_header, attempt)
>   File "C:\Google\depot_tools\gclient_utils.py", line 533, in show_header_if_necessary
>     stdout_write(header.encode())
>   File "C:\Google\depot_tools\gclient_utils.py", line 391, in write
>     obj[0] += out
> TypeError: can only concatenate str (not "bytes") to str
> 
> Bug: 984182
> Change-Id: If7037d30e9faf524f2405258281f6e6cd0bcdcae
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1778745
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Raul Tambre <raul@tambre.ee>

TBR=dpranke@chromium.org,ehmaldonado@chromium.org,raul@tambre.ee

Change-Id: I5ea8d3249c58a3487996649a264bb5be059fe884
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1845500
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Raul Tambre 5d284fdf48 gclient_utils: buffer output as bytestrings in Annotated
In Python 3 byestrings and normal strings can't be concatenated.
To fix this we buffer as bytestrings in the Annotated wrapper.
We can't decode to a string because the output might come byte-by-byte, so it doesn't work with Unicode characters like ✔.

Also had to update gclient_test.py, where double-wrapping stdout with Annotated caused made output not work and include_zero=True working caused other unintended side-effects.

Example error from "fetch chromium":
Traceback (most recent call last):
  File "C:\Google\depot_tools\gclient_scm.py", line 1045, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "C:\Google\depot_tools\gclient_scm.py", line 1370, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "C:\Google\depot_tools\gclient_utils.py", line 583, in CheckCallAndFilter
    show_header_if_necessary(needs_header, attempt)
  File "C:\Google\depot_tools\gclient_utils.py", line 533, in show_header_if_necessary
    stdout_write(header.encode())
  File "C:\Google\depot_tools\gclient_utils.py", line 391, in write
    obj[0] += out
TypeError: can only concatenate str (not "bytes") to str

Bug: 984182
Change-Id: If7037d30e9faf524f2405258281f6e6cd0bcdcae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1778745
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
5 years ago
Edward Lemur efce0d1b76 gclient_utils: Fix bug in CheckCallAndFilter in Python 3.
Header was printed using sys.stdout, but the rest of the output was
printed using sys.stdout.buffer, causing the output to be written
before the header.

Bug: 984182
Change-Id: If6aaa05a579c3b0c73ce8ffe48f3a4e777fa16fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1790254
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lemur a877ee62b1 depot_tools: Run some tests on Python 3 on the bots.
Bug: 984182
Change-Id: I0b7f1e3e056548a27a416c9b4078e54c9e5d60d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1769400
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lemur 614050efa0 depot_tools: Stop using mox on gclient_utils_test.py.
Bug: 984182
Change-Id: Ie29f06c817824c009656cf81d93a605abebe948a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1754976
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 24146be833 depot_tools: Simplify CheckCallAndFilter[AndHeader]
- Merge CheckCallAndFilter[AndHeader]
- print_stdout will cause command output to be redirected to sys.stdout.
- Made compatible with Python 3.

Bug: 984182
Change-Id: Ida30e295b872c8c1a1474a376a90aecea924f307
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1727404
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Edward Lesmes c0758331ea Revert "depot_tools: Make gclient_utils Python 3 compatible."
This reverts commit 602076dcf2.

Reason for revert:

It fails on input 0xe2 0x9c 0x94 which is a utf-8 heavy check mark. Problem is that CheckCallAndFilter is processing output byte by byte, so trying to decode only one of utf-8 bytes in sequence will always fail.

Original change's description:
> depot_tools: Make gclient_utils Python 3 compatible.
> 
> Bug: 984182
> Change-Id: Ifb93466dcb7541f46c31c9b298049c425dd150d6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1715472
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 984182
Change-Id: Ieae421acc430a031621db3329223c1da85506e55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1724730
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 602076dcf2 depot_tools: Make gclient_utils Python 3 compatible.
Bug: 984182
Change-Id: Ifb93466dcb7541f46c31c9b298049c425dd150d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1715472
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Raul Tambre 1fb046306b Fix UTF-8 output in gclient_utils.CheckCallAndFilter
Hooks for Electron output UTF-8 characters.
Example error for when "✔" is output:
  File "/home/markus/depot_tools/metrics.py", line 266, in print_notice_and_exit
    yield
  File "/home/markus/depot_tools/gclient.py", line 3112, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/markus/depot_tools/gclient.py", line 3098, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/home/markus/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/home/markus/depot_tools/gclient.py", line 2677, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/home/markus/depot_tools/gclient.py", line 1746, in RunOnDeps
    self.RunHooksRecursively(self._options, pm)
  File "/home/markus/depot_tools/gclient.py", line 1052, in RunHooksRecursively
    hook.run()
  File "/home/markus/depot_tools/gclient.py", line 245, in run
    cmd, cwd=self.effective_cwd, always=self._verbose)
  File "/home/markus/depot_tools/gclient_utils.py", line 344, in CheckCallAndFilterAndHeader
    return CheckCallAndFilter(args, **kwargs)
  File "/home/markus/depot_tools/gclient_utils.py", line 576, in CheckCallAndFilter
    stdout.write(in_byte.decode())
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe2 in position 0: unexpected end of data

This issue was introduced in CL:1524583.

Bug: 942522
Change-Id: I3c4355b925b34398c800d142f942531a829e0297
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1541334
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
6 years ago
Nico Weber 8db10a6fb1 gclient: Stop printing newline in front of "________ running hook"
The newline is probably here to protect against a hook that doesn't print
a trailing newline.  I've never seen a hook that did that, and if we found one,
we could make the logic look like "print a trailing newline if it's not there"
-- or just fix the hook.

The newline has been around since depot_tools was created
(https://codereview.chromium.org/92087, gclient.py), back then this was in
a general "run stuff" function, not in hooks-specific code.  Maybe it made
more sense back then.

This is part of a few changes to make `gclient runhooks` less noisy.

Bug: 772741
Change-Id: I285f76dc3f01c5acf5bbaa0be4db9f6edb9c0366
Reviewed-on: https://chromium-review.googlesource.com/706914
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
8 years ago
Quinten Yearsley b2cc4a94da depot_tools: Replace pylint error numbers with symbolic names.
This affects a bunch of files, but only changes comments,
and shouldn't make any difference to behavior.

The purpose is to slightly improve readability of pylint
disable comments.

Change-Id: Ic6cd0f8de792b31d91c6125f6da2616450b30f11
Reviewed-on: https://chromium-review.googlesource.com/420412
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
8 years ago
tandrii 64103db728 Revert of gclient: kill git fetch operation that hangs. (patchset #12 id:220001 of https://codereview.chromium.org/2241843002/ )
Reason for revert:
Didn't help.

Original issue's description:
> gclient: kill git fetch operation that hangs.
>
> This provides env variable GCLIENT_KILL_GIT_FETCH_AFTER
> that kills git fetch if it produces no output for that
> many seconds.
>
> Note that this is not final patch, but an experiment.
> See http://crbug.com/635641#c24 for the deployment plan.
>
> BUG=635641
> R=hinoka@chromium.org
>
> Committed: f8757b7e02

TBR=hinoka@chromium.org,hinoka@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=635641

Review-Url: https://codereview.chromium.org/2410853002
9 years ago
tandrii 30d956272d Revert of bot_update/gclient: kill git fetch after timeout regardless of output. (patchset #2 id:20001 of https://codereview.chromium.org/2293013002/ )
Reason for revert:
didn't work.

Original issue's description:
> bot_update/gclient: kill git fetch after timeout regardless of output.
>
> Also spits out whatever output was produced by git fetch for debugging.
>
> BUG=635641
> R=machenbach@chromium.org,hinoka@chromium.org
>
> Committed: db8b839320

TBR=hinoka@chromium.org,machenbach@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=635641

Review-Url: https://codereview.chromium.org/2410053002
9 years ago
tandrii db8b839320 bot_update/gclient: kill git fetch after timeout regardless of output.
Also spits out whatever output was produced by git fetch for debugging.

BUG=635641
R=machenbach@chromium.org,hinoka@chromium.org

Review-Url: https://codereview.chromium.org/2293013002
9 years ago
tandrii f8757b7e02 gclient: kill git fetch operation that hangs.
This provides env variable GCLIENT_KILL_GIT_FETCH_AFTER
that kills git fetch if it produces no output for that
many seconds.

Note that this is not final patch, but an experiment.
See http://crbug.com/635641#c24 for the deployment plan.

BUG=635641
R=hinoka@chromium.org

Review-Url: https://codereview.chromium.org/2241843002
9 years ago
scr@chromium.org f1eccafb1c Make it possible to refer to github-style URLs.
BUG=362248

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@263252 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
stip@chromium.org 626e77d9d3 Make rietveld test work on port 10000.
depot_tools PRESUBMIT.py and tools/build PRESUBMIT.py both run on cq.golo.

If broken dev_appserver.py instances are left around, they will conflict with
master ports.

BUG=351926

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256721 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com 267f33e6ad Make gclient_scm.py use cache_dir
Instead of having custom logic for dealing with cache directories, use
git_cache.py to populate caches.

Also fixes a bug in git_cache.py where it was looking for lockfiles in cwd rather than the cache dir.

Other changes:
* _Run now returns output.
* Always print to stdout in CheckCallAndFilterOutput, even if it gets a carriage return.  This is done because git progress report are carriage returns and not newlines and we don't want everything on the same line and not strip out the CRs.
* Removed members changed tests, its not very useful to know a new import is added.

BUG=339171

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@254248 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 6c2b49d392 Revert "Re-re-land gclient deletion of mismatching checkouts again"
This reverts commit 6ff5448534.

'fetch --nohooks chromium' is broken with this change.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253640 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
borenet@google.com 6ff5448534 Re-re-land gclient deletion of mismatching checkouts again
Review URL: https://codereview.chromium.org/164053003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253616 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
agable@chromium.org 5a306a2aa6 Create "git cache" command.
The git cache command is a central place to manage a machine's git cache.

It provides two subcommands:
* populate -- creates or updates the cache of a given repository
* exists -- prints the path to the cache of a repo, if it exists

Gclient, deps2git, bot_update, and any other tools that touch the cache will
be able to use this command to make sure that everyone is interacting with
the cache in the same way.

R=hinoka@chromium.org, iannucci@chromium.org
BUG=339168

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253007 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nick@chromium.org 3ac1c4e320 Depot tools: use the clang-format binaries that are now included
as part of the Chromium checkout.

This follows the approach used by gn.

Changes include:
 - in-the-PATH clang-format trampoline scripts
 - clang_format.py, which finds clang-format binaries inside of Chrome
 - Hook 'git cl format' to the new binaries and scripts
 - Rearrange some code, for reuse between clang_format.py and gn.py

BUG=240309
TEST=presubmits (one failure on mac, but it fails on a clean checkout too)

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@245074 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org f2d7d6b518 Consolidate subprocess retry logic into gclient_utils.
Add retry for all git operations that speak to a remote.  This
should smooth out issues with the git/gerrit-on-borg service.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@229219 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
cyrille@nnamrak.org ef509e48b1 Added SafeRename to better handle problems with git processes locking directories.
This solves a problem with "os.rename" sometimes failing with an
exception after cloning a dependency to a temporary directory. It's
possible the dying git processes still hold a handle to the directory.
Since gclient delete the temporary directory regardless of the success
of the process, it results in a lot of GB downloaded for nothing.

SafeRename solves this by retrying a few times if the renaming fails,
sleeping one second every time to get other processes the time to
release their lock on the directory. It gives up retrying after 15 times.

BUG=
R=maruel@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23875041

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@224372 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org c28d377739 Print time of long running hook actions
We can use this to evaluate the usefulness of making hooks run in parallel.

Review URL: https://chromiumcodereview.appspot.com/18851005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@211446 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
xusydoc@chromium.org 2fd6c3fcb7 Kill subprocesses on KeyboardInterrupt.
SVN traps SIGINT and attempts to clean itself up, but this results in hangs
waiting for TCP. This patch does two things: daemonizes worker threads so they
are culled when the main thread dies (is ctrl-C'd) and keeps track of spawned
subprocesses to kill any remaining ones when the main program is ctrl-C'd.

A user ctrl-C'ing gclient has to manually terminate hung SVN processes, so this
introduces no extra data loss or hazard. stracing a hung SVN process shows that
it is indeed hanging on TCP reads after receiving a SIGINT, implying there is an
underlying but in the SVN binary.

Review URL: https://chromiumcodereview.appspot.com/14759006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@198205 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
digit@chromium.org dc112ac587 Remove gclient_utils.RemoveDirectory().
The 'RemoveDirectory()' function in gclient_utils is deprecated and
rmtree() should be used instead for consistency.

This patch modifies all clients in depot_tools to use rmtree() instead
and removes the RemoveDirectory function.

+ The SVNWrapperTestCase.testRevertNoDotSvn() mocking
  expectation has been slightly changed. This was required
  because the test invokes code that used to call
  gclient_utils.RemoveDirectory() directly, while only
  gclient_utils.rmtree() was mocked.

BUG=NONE
R=maruel@chromium.org, ilevy@chromium.org
TEST=manually run gclient_utils_test / gclient_smoketest / scm_unittest / gclient_scm_test

Review URL: https://chromiumcodereview.appspot.com/14134010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@196133 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
borenet@google.com 6b4a2ab6ad Use rd on Windows in rmdir
This is needed because the current implementation commonly fails on Windows due to "directory not empty" errors.  Using rd is more reliable.

Review URL: https://chromiumcodereview.appspot.com/13581005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194932 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 1369150868 Make gclient sync use cpu count for default jobs
- On high core, fast machines, jobs=8 is does not offer good
  parallelization.  Switch to use number of local cpus.

R=maruel@chromium.org
BUG=


Review URL: https://chromiumcodereview.appspot.com/11140019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@162072 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
jam@chromium.org 07d44398a2 Switch gcl/git upload to use https://codereview.chromium.org instead of https://chromiumcodereview.appspot.com. It's been a week since the SSL certificate got added, and the old DNS records had a TTL of 7 days.
Review URL: https://chromiumcodereview.appspot.com/10910225

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@156316 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org dae209fb46 Enforce utf-8 codec on all files read and write.
Otherwise, the files are opened in 'whatever happens to be the current encoding'
which is highly system-dependent. Even if some files are not encoded with utf-8,
the status quo is even worse. So it's worth trying out.

TBR=cmp@chromium.org
BUG=
TEST=


Review URL: https://chromiumcodereview.appspot.com/10697036

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@145306 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 2a0108ebdb Revert r132446 "Check the existence and executability of scm commands"
This completely broke syncing on Windows.

TBR=mukai@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9956149

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@132451 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
mukai@chromium.org d15a8fa135 Check the existence and executability of scm commands
BUG=114483
TEST=manually

Review URL: http://codereview.chromium.org/10034011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@132446 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org eb5edbcfde Add UpgradeToHttps() to reliably and forcibly upgrade all urls to https.
Enable it for git-cl and gcl.

R=nsylvain@chromium.org
BUG=107838
TEST=New connections go through https://


Review URL: http://codereview.chromium.org/9214004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@117857 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 99ac1c5808 Dedupe codereview.settings parsing code. Add more testing.
So any modification to the defaults is coded at only one place.

TBR=nsylvain@chromium.org
BUG=107838
TEST=


Review URL: http://codereview.chromium.org/9214002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@117853 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 0927b7eef8 Create a new testing_support module to move utility modules there
It will simplify importing utility modules from other projects. Otherwise I was getting name conflicts with 'test'.

Reenable W0403 that was disabled in the previous CL.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8508015

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109636 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 428342a0a7 Standardize the sys.path fix up and fix a few pylint warnings.
Disable temporarily W0403, will be reenabled on the next CL

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8508017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109435 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 0e0436a662 Move code starting the editor into a common function.
Windows users wouldn't get the same behavior on git cl vs gcl.
Improve automatic CRLF<->LF conversion, some gcl users would be \n repeated in
their description depending on the editor used.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8360007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@107106 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 042f0e73de Improve the sys.stdout proxy to be more transparent.
Otherwise isatty() could not be proxied correctly.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8370004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@106864 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6c48a304d4 Fix a concurrency issue happening with deep dependencies when the intermediary
directory doesn't exist, on fresh checkout and --jobs >1.

It happens in the case where there is 3 dependencies:
a
a/b/c/d
a/b/c/e

'a' is processed first. Then 'a/b/c/d' and 'a/b/c/e' are fired simultaneously.
If both are not present, both svn checkout tries to mkdir b and b/c and a race
condition occurs between their call for isdir() and mkdir().

This works around the issue by creating the intermediary directories ourself
before calling out svn and managing the error ourself.

TBR=dpranke@chromium.org
BUG=
TEST=fresh checkout shouldn't be flaky


Review URL: http://codereview.chromium.org/8359018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@106636 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6ca8bf80b4 Retry "Initial step into making Dependency thread safe""
I had forgot one access to _requirements. Now that tests are run, this change is
safer to commit.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7909012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@101856 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org fae707be99 Fix a typo that resulted in no tests to be run in depot_tools. :(
Add a warning when RunUnitTestsInDirectory() finds no test to run to
catch this kind of regression.

Fix all the regressions that where introduced in the meantime...

TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7906009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@101347 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
floitsch@google.com eaab784bcf Add --transitive flag.
When specifying a revision (with -r) propagates the date of the revision to its children.

Review URL: http://codereview.chromium.org/6873110

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