Commit Graph

92 Commits (fd19a3032fac02441a44da69e1ce1fca51b97e55)

Author SHA1 Message Date
maruel@chromium.org ca0f839801 Make gclient_utils.CheckCallError inherit from subprocess2.CalledProcessError.
This will simply the transition

R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100174 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
nsylvain@google.com e939bb5de3 Remove empty lines from the output while using --jobs.
While using --jobs, empty lines are adding a lot of noise.

An example output would look like:

>gclient sync --jobs=10
1>
3>
4>
6>
5>
7>
5>
5>________ running 'git clone ...'
Review URL: http://codereview.chromium.org/7101012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87542 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
maruel@chromium.org ff3e4a87b1 Fix constructor arguments to OSError.
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82763 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org ade9c5953d Fix case where wc_info is not present.
Reapply r80770 "Switch from xml.dom.minidom to xml.etree".

TBR=dpranke@chromium.org
BUG=
TEST=

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80785 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org d25fb8f68b Revert r80770 "Switch from xml.dom.minidom to xml.etree"
Throws exceptions on mac.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80771 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 949d1a6a9e Switch from xml.dom.minidom to xml.etree
The reason of this change (beside deleting 30 lines) is to fix pylint on Mac.
For an unknown reason, it was dying here trying to process the minidom import.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80770 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 58ef297bc5 Revert r80216 "Reapply r79779: "Removed gclient_utils.Popen() and use subprocess2's ...""
Horked windows slaves this time.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80220 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 93ef410768 Reapply r79779: "Removed gclient_utils.Popen() and use subprocess2's version instead."
It should be fine now that I've fixed python2.5 compatilibity issues in subprocess2.py.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80216 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 5a376ed328 Revert r79779: "Removed gclient_utils.Popen() and use subprocess2's version instead."
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79781 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 242549409f Removed gclient_utils.Popen() and use subprocess2's version instead.
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79779 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 20254fc742 Revert r79002 - bug processing reviewer lists
TBR=maruel@chromium.org

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79005 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 0c20c2fc23 The parsing of change descriptions had a lot of overlap and inconsistencies between gcl and git-cl. In particular, we weren't handling TBR= consistently, or probably a few other things.
This change moves most of the code into presubmit_support and gclient_utils and just leaves the formatting differences for the messages between the two tools.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79002 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 97ae58eb0a Make git_cl (and everything else not skipped under depot_tools)
pass pylint cleanly.

There should be no functional changes in this patch, although there's at least one minor bug that lint caught.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78638 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 1edee69142 Fix win32api and win32con definition order.
It would fail on win32 when these modules are not present.

BUG=75902
TEST=none

R=mhm@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77947 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org f9040728dc Shorten RemoveDirectory and rename to rmtree. Remove rmtree from fake_repos.
Keep an alias to RemoveDirectory, will be removed in a later change.

TEST=new unit test to test this function
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77463 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 31f10a863c Remove unneeded logging.info() calls.
TBR=bradnelson
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@75918 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
thakis@chromium.org 3487f7f45f Add more logging. Useful to understand `git try` slowness.
Review URL: http://codereview.chromium.org/6247008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71602 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 1bd1ed3cc6 Add more exception information to breakpad.
When an HTTP exception information is logged, no information is sent by
default. Add an helper function to manually extract interesting information
to append it to the exception type.

Also disable another pylint warning.

TEST=manual test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@67306 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 0661727bdc Reduce the chances for gclient to throw an exception in subprocess module.
Python standard library is not thread safe. Work around it by leaking a bit.
The problem is particularly visible on python 2.4.

TEST=none
BUG=60623

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@65048 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b17b55beca Disable the remaining pylint warnings locally and enable pylint warnings in PRESUBMIT.
This causes some code clutter.

TEST=Increased pylint warning level
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64913 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cb2985fb69 Largely reduce the number of pylint warnings and fix one typo.
Most of them are style issues or variable aliasing.

TEST=Can almost enable pylint warnings
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64908 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 78b8cd14ef gclient can now handle git URLs containing "-" in usernames and "~" in paths.
Contributed by Torsten Becker <torsten.becker@gmail.com>

BUG=
TEST=gclient config 'ssh://user-name@asd.com/~/asd.git' && gclient sync  # fails in SplitUrlRevision

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63877 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ac61023c2c Fix a bug in gclient recurse for git-svn users. Make gclient_utils.CheckCall more versatile.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@62400 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 55a2eb8871 Display the name of the repository that is being updated.
Patch contributed by Anton Staaf.

BUG=None
TEST=run "gclient config ...; gclient sync chromium"

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61733 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 77e4ecaf59 Remove cruft from having to do bookeeping of options.stdout.
This makes the code saner to understand.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@60050 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 4ed3418912 Directly hook sys.stdout for thread annotated output.
In the next change, we can now remove all the options.stdout bookeeping since
it's not unnecessary.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59795 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org e0de9cbe0f Remove the class StdoutAnnotated and clones the object instead.
The end goal is to remove options.stdout, to remove a lot of bookkeeping.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59792 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8aba5f7305 Add a nice message for cygwin users, telling them to rebase when necessary.
BUG=53483
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59699 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org acc4567100 Enable parallel checkout by default to --jobs=8 and smoke tests.
BUG=54084
TEST=updated smoke test and added a new one + stdout untangling

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59002 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cb1e97a1a2 Enable annotated output for --jobs N!=1.
TEST=none
BUG=54084

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58985 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3742c84587 Add the infrastructure necessary to support annotated stdout.
Simplify ExecutionQueue.run() by moving code into utility functions.

Reduce the amount of code in WorkerThread.run() to improve reliability.

Don't trap exceptions in single-threaded usage!

BUG=54084
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58974 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ad80e3b96e Simplify GIT.Capture() code to always redirect stderr by default and always throw an exception on failure.
Make gclient_scm_test silent.

Replace raise Exception() with raise gclient_utils.Error().

BUG=54084
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58936 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9c53126dd6 Enter a description of the change.
Add back support for python 2.4.

Looks like a few slaves haven't been updated yet.

TBR=bradnelson
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58820 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org db111f71cf Add automatic auto-flushing stdout.
An automated work around for python lack of stdout flushing.
This design simplifies life once parallel checkout is enabled.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58819 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
jochen@chromium.org 20760a543c Do not blindly assume that a .gclient file in a parent directory belongs to the current directory.
BUG=54238
TEST=gclient_smoketest.py
Review URL: http://codereview.chromium.org/3342020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58800 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 7b194c1a05 Improve exception handling.
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58756 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 66c83e68b7 Rename retcode to returncode to be consistent with subprocess.
Change CheckCallError to inherit from Error. This will simplify try/except changes.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58695 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a1693bef5a Remove kwargs copy, it is not necessary. Remove ordered argument support from popen to simplify it.
Move logging call to the base function.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58523 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 17d01795a6 Cleanup the code in gclient_utils to standardize on CheckCall nomenclature.
Simplify code by removing fail_status
Rename print_messages to always
Simplify the doc.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58201 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 2b9aa8e0b3 Refactor SubprocessCallAndFilter() to remove positional arguments.
This way the function is much more similar to subprocess.call(). Further changes
will be done, to be able to convert all the function, to be able to parallelize
output without corrupting it.

Used pylint to verify call graph correctness, causing some other unrelated
changes.

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57369 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 559c3f89b6 Add stdout param to SubprocessCallAndFilter().
It will eventually replace 'print_messages' and be used to annotate printed
lines when using --jobs.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57092 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3a292688b6 Redo of r56893 with fix to support python 2.5.
Original Description:

Remove code duplication and improve style.

Create a Popen function to reduce code duplication.
Use RemoveDirectory where relevant.
Make drover slightly more posix friendly.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57083 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a488c7d7bf Fix for files not ending with \n, otherwise the last line would be ignored.
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57010 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ad0b13da3d Revert "Remove code duplication and improve style."
This reverts commit 850ee065dd.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56894 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 850ee065dd Remove code duplication and improve style.
Create a Popen function to reduce code duplication.
Use RemoveDirectory where relevant.
Make drover slightly more posix friendly.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56893 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org c41c27c86e Force LANGUAGE=en to fix svn output parsing
TEST=Run with LANGUAGE=fr_CA, gclient still works.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56354 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
chase@chromium.org 8ad1cee657 Flush more often in gclient's SubprocessCallAndFilter.
Speed up flushing of output on platforms that may not
flush as often as we expect (like Windows).  Wait at
least 10s between flushes to avoid overloading busy
readers.

BUG=none
TEST=gclient flushes on Windows more often, regular
gclient operations continue to work as expected
Review URL: http://codereview.chromium.org/3140013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56217 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org c8d064b447 Add back stack location to gclient exceptions.
Needed to use the special 3 args raise notation.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56209 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9e5317ac38 Add --jobs support to gclient. --jobs=1 is still the default for now.
Huge thanks to piman@ for working on a patch. I chose a different design but he
gave me motivation and ideas. Sorry for not accepting his patch earlier, this
was mostly due to broken gclient implementation itself.

gclient can now run an unlimited number of parallel checkouts and always keep
the checkout coherency correct.

--jobs=1 is single threaded as before, albeit with a different code path.

Issues:
- Using --jobs with a value other than 1 will result in a mangled output.
- Exceptions thrown in a thread will be have the wrong stack trace.

TEST=gclient sync -j 99 in a ssh:// chromiumos checkout is dramatically faster.

---

Here's the perf on linux on i7-860 for a chromium checkout with warm cache. Cold
cache will result is significantly reduced improvements so this is best case
improvements. The sync was no-op all the time except where noted. All execution
where with "time gclient sync " + args. Didn't include 'sys' column since it was
statistically insignifiant and highly correlated with 'user'.

           runs with -f        runs with -m      without -f nor -m
 args          real    user      real    user      real    user
 -j 12       20.59s  18.00s     5.64s   7.95s     5.86s   8.10s
        #1 1m05.26s  20.02s     5.20s   7.94s     5.10s   8.09s
             22.79s  18.17s
 -j 1   #2 1m47.00s  16.72s     9.69s   5.72s    12.35s   5.96s
           1m31.28s  17.06s     9.54s   5.85s    10.51s   6.20s
           1m31.79s  16.39s
 before #3 1m30.94s  16.74s     9.77s   5.83s    10.45s   5.77s
           1m30.17s  17.30s    10.36s   5.68s    10.16s   5.88s
 hook #4      8.52s  7.93s
              8.73s  8.13s

#1 This particular run synched to r56023, a webkit roll updating layout tests.
   It's still faster than a no-op sync without parallel checkout.
#2 Maybe there was a sync or computer hickup, I didn't realize.
#3 This is depot_tools@56020
#4 Since -f implies runhooks, I ran the hook 'python src/build/gyp_chromium'
   manually to compare. Hooks are still run in a single thread. I didn't rest
   'gclient runhooks'.

I tried to go a ssh:// checkout of chromium os tree but it timed out everytime I
tried to sync so I couldn't get data points. I expect an order of magnitude of
improvement or more.

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

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