Commit Graph

333 Commits (5a2fefb9ebf89806b6b6a5aeead5dad5855fc476)

Author SHA1 Message Date
maruel@chromium.org dd057f38b5 Add automated sys.stdout check.
Had to update a few tests, removed redundant code in gclient_scm_tests.

TEST=more readable unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59959 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 aef9e440f2 Fixes the remaining failures gclient_smoketest on Windows.
TBR'ing since the change is fairly trivial.

TBR=bradnelson
TEST=moar tests fixed
BUG=none
Review URL: http://codereview.chromium.org/3329023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59148 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 5631746743 Improve the testing situation on Windows.
For now that involves disabling a lot of tests when they can't be run.

I'm unsure about the ascii encoding, it fails here if I keep this call on a French UI.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3333028

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59137 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 389d6dea37 Improve tests and remove some unused GIT test.
This is needed to improve the git tests further in a later change.

BUG=54084
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58934 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 54019f3c98 Change scm.SVN.Capture to redirect stderr and throw an exception on call failure.
Added try/except to the places where errors are tolerated.

Renamed scm.SVN.CaptureBaseRevision to CaptureRevision and removed CaptureHeadRevision.

BUG=54084
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58932 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 37e89873a4 Add options argument to _Run() to redirect output.
Add automatic 'header' on command execution

BUG=54084
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58700 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 158040918c Revert "Do not blindly assume that a .gclient file in a parent directory belongsto the cu..."
This reverts commit 58371

TBR=jochen
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58372 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
jochen@chromium.org 2509f86654 Do not blindly assume that a .gclient file in a parent directory belongs to the current directory.
BUG=54238
TEST=GClientSmoke.testWrongConfig

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58371 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org d765d9c848 Revert "Do not blindly assume that a .gclient file in a parent directory belongs to the cur..."
This reverts commit 58352.

TBR=jochen
BUG=breaks build bots

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58355 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
jochen@chromium.org 9806750e14 Do not blindly assume that a .gclient file in a parent directory belongs to the current directory.
BUG=54238
TEST=GClientSmoke.testWrongConfig

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58352 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 669600d394 Remove scm.SVN.Run() and all stdout argument to more calls.
BUG=54084
TEST=unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58214 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
bradnelson@google.com c0b332a8cb Adding json based tree open check.
BUG=None
TEST=None

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57438 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 10ccd1124c Disable the use of -s or --server with gcl upload.
It contradicts the previous changes to enforce codereview.settings.

TEST=new unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57195 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 dd218e5997 Make codereview.setting syntax more liberal and add more unit tests.
Improve gclient_utils to test output lacking trailing LF

BUG=none
TEST=new unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57047 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 b826024d06 Remove the default values and add a comprehensible error message.
Review URL: http://codereview.chromium.org/3156034

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56699 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
maruel@chromium.org 399318ec99 Fix gclient_utils_test and disable gclient_scm_test.
gclient_scm_test is really flaky and is a pain to maintain. gclient_scm.py
coverage is good enough with gclient_smokte_test.

TBR=chase

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56351 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0380707ce2 Remove 'options' usage from scm.py
This is towards cleaning up the mess with 'options' in gclient_scm.py.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56213 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 80cbe8b7d1 Move ExecutionQueue and WorkItem to gclient_utils.py
Review URL: http://codereview.chromium.org/3107009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56020 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ce46489487 Remove semicolons from revinfo.
I've never known why there were added in the first place

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55896 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 049bcedffe Add new class ExecutionQueue to take care of out-of-order execution.
ExecutionQueue takes care of reordering execution depending on each Dependency
requirements. There is no need to sort anymore.

ExecutionQueue also manages the Progress instance and is multithread safe, in preparation to parallel checkout.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55882 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b1e315f9e8 Add revinfo --actual to fetch the actual revisions,
gclient revinfo alone will now not return the actual checked out revisions but simply what's in the .gclient&DEPS.

BUG=none
TEST=add a --snapshot test to make sure it is not broken

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55760 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org da7a1f902a Fix logic error in LateOverride().
It would modify self.parsed_url even when it's called for a From() keyword

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55574 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org e407c9ae28 Add code to automatically svn cleanup during svn update.
BUG=36135
TEST=gclient sync on a svn lock'ed directory will work automatically

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55438 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
jochen@chromium.org ea85743f57 Fix unit tests not to choke on the no-try info message.
BUG=none
TEST=gcl_unittest

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@54442 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
bradnelson@google.com 5f8f2a8402 Reverting 53377, horks webkit waterfall.
BUG=None
TEST=None
TBR=maruel

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@53419 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cefc9d9113 Don't sort dependencies by name anymore since it can be an issue for some kind of DEPS setup.
PageSpeed is an example of such ordering dependency.

TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@53377 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org df2b31582f Reapply gclient.py refactor for the third time.
Bring some OOP and sanity to gclient.py.

- Changed the algorithm from breadth-first to depth-first.
- Added infinite recursion support.
- Fixed From() of From() dependency.
- Fixed cross solution custom deps aliasing.
- Removed support code for old .gclient_entries format.
- Removed IsGitCheckout() in favor for a direct check for .git presence.

TEST=all test pass

The main difference with r51760 is that new smoke tests have been added since which replicates how webkit checkouts with gclient.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@53205 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
sky@chromium.org 5db5ba5616 Changes gcl upload to not submit a try.
This is the same as the last cl, but hopefully with the right svn
server.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@53043 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 6f71d093d9 Add a test more representative of what WebKit does.
Emulate running gclient from a checkout containing .gclient and a DEPS, with the
solution having an url set to None.

TEST=new smoke test

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52119 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org baa578e3d0 Add testing for a solution entry where url = None.
This is being abused by WebKit.

TEST=new smoke test

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52096 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9b13351cd7 Add testing for the From(File()) case, fix revinfo.
This case covers the webkit gclient usage.

TEST=improved smoke test

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52092 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org e5a71c9d4b Fix for non English interface.
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52064 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org dc7445dd70 Revert the refactor (r52005) again, it broke webkit checkout.
TBR=msb

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52011 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 917aa91750 Reapply r51760 and r51761 that were reverted in r51767.
Add the fix for FileImpl() plus unit tests.

TEST=more tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52005 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org e3216c6e26 Improve testing with File() keyword, found a few bugs along the way
TEST=new smoke tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51824 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 5248d9dfe3 Revert both r51761 and r51760 as it broke the webkit slaves.
TBR=msb

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51767 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org adecb3162f Bring some OOP and sanity to gclient.py.
- Changed the algorithm from breadth-first to depth-first.
- Added infinite recursion support.
- Fixed From() of From() dependency.
- Fixed cross solution custom deps aliasing.
- Removed support code for old .gclient_entries format.
- Removed IsGitCheckout() in favor for a direct check for .git presence.

TEST=all test pass

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51760 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 5990f9d536 Give more simple message when a SyntaxError is thrown
TEST=none, no big deal. I'll get a breakpad report otherwise anyway. This is solely to *reduce* the number of breakpad stack trace that this is done.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51739 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 73e2114e7d Mixed bag of nits.
Remove SUPPORTED_COMMANDS since it is not necessary, change the formating to not introduce an empty line.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51640 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
piman@chromium.org 4b90e3a55b Add gclient recurse
This allows to recurse in all the entries to operate on them.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51419 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 271375b004 Move DEPS parsing into a single function. This is a move towards having each DEPS entry being a Dependency instance.
TEST=new revinfo unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@50630 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0d425926d8 Revert r50367 "Move DEPS parsing into a single function." yet again...
TBR=nasserg

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@50372 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 6b57049528 Move DEPS parsing into a single function. This is a move towards having each DEPS entry being a Dependency instance.
TEST=new revinfo unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@50367 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 115ae6cab3 Makefiles will always contain tabs so make the notab check filter them out.
Review URL: http://codereview.chromium.org/2814017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@50251 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b1901a6e45 Look for PRESUBMIT.py beyond root if inherit-review-settings-ok is present.
Patch contributed by Darin Petkov

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49868 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9eda411072 Incremental changes towards more efficient refactoring of gclient.py
Fix gclient diff & pack to not throw uncatched exceptions when a directory is missing.

Reorder things in gclient.py for easier diff later
Update revinfo help
Add GetScmName(), it will be needed later.

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49565 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org f0fc991611 Options cleanup, enforce nohooks and deps_os are always defined.
Review URL: http://codereview.chromium.org/2776006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49554 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a4400f4718 Add more forced revisions in fake_repos.py and adds a recursive DEPS.
The recursive DEPS is to be used with From() testing.

Didn't enable From() yet since it broke tests and to simplify this change.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49427 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
cbentzel@chromium.org 4d7400397b Fix gcl_unittest: shutil is not imported by gcl.py.
Review URL: http://codereview.chromium.org/2627010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49049 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 524a6eda43 Significantly improve gclient_smoketest.py.
Add a lot of checking for stdout and fix one mis-assumption.
Make the code much more compact.
Make the git_hashes 'revisions' 1-based for consistency.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48925 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org 99828125dd Take 2 at adding --force to svn update and svn checkout.
Turns out that this was added in svn 1.5 and the mac bots
use svn 1.4.4.
Review URL: http://codereview.chromium.org/2623002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48899 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org 2151c2904b Revert r48897, --force doesn't work on svn 1.4 which is used on mac.
TBR=maruel

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48898 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org fb176482f3 When running an svn update, if --force was passed on the
command line to gclient, pass the flag to svn update and
svn co too.

This allows updates when we have dirty files left around.
For example, an update may remove a directory, but the
directory still has .vcproj or .mk files in it.  If we
try to re-add that directory, svn will error out.  If
we add --force, it'll happily allow the update.
Review URL: http://codereview.chromium.org/2560001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48897 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org 786fb68d39 gclient_scm.py: Make working with git more reliable
I found including a git repo in my DEPS file to be unreliable, esp
since I pinning to a specific commit. Whenever I changed the commit
in the DEPS file, gclient would attempt to do a rebase and this was
failing due to how rebase was being invoked.

While investigating the problem, I decided it might be better to take
a different approach. Namely, when cloning gclient should just checkout
the working tree to a detached HEAD. In this way, gclient can more
easily determine if the user has made any changes in the cloned repo.
Future updates (as long as there are no changes) become a much simpler
operation w/no need to invoke rebase.

This is a series of five commits, but sadly, git cl will squash them
into this single review. Here are the original commit messages:

commit 8cd2213f006a6f4b3f6b8c448a1362b9410d47f1
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 18:29:18 2010 -0400

    Use rev-parse to determine current branch

    Git branch is a so-called porcelain and its output cannot be relied upon;
    use git rev-parse instead.

 gclient_scm.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

commit 1a09e04554acfa2671f9588ee9eef0bdbe677ed2
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 22:16:53 2010 -0400

    Detached HEAD does not always imply rebasing; use an _IsRebasing()
    function instead.

 gclient_scm.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

commit 45308a58c3f1e30b760f13abe3a6288267265fa8
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 22:19:10 2010 -0400

    Clarify comments to use common git terminology

 gclient_scm.py |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

commit 5e5a661b7dd9c83b2c9c35950f3267d15b7e840a
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Tue May 4 12:15:40 2010 -0400

    Make CaptureStatus use GetUpstreamBranch() instead of assuming 'origin'

 scm.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

commit 42a8bfebd2e1b1be01025c1324d75920ac6eb0e1
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 22:19:29 2010 -0400

    Use a detached HEAD when checking out a tag or commit

    After cloning, if a tag or commit was specified, leave a detached HEAD. This way
    we can reliably detect if the user changed the working tree (since HEAD would no
    longer be detached). Further, this simplifies the code path when the dependency
    is updated to a new tag/commit. As long as HEAD is detached when we update, we
    simply checkout whatever we fetched w/o needing to worry about rebasing.

 gclient_scm.py            |  126 +++++++++++++++++++++++++++++++-------------
 tests/gclient_scm_test.py |    6 +--
 2 files changed, 91 insertions(+), 41 deletions(-)

Review URL: http://codereview.chromium.org/1652007
Patch from Jay Soffian <jaysoffian@gmail.com>.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48722 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8b599cfa42 Fix gclient_smoketest for svn 1.5 and python 2.5
Review URL: http://codereview.chromium.org/2487003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48688 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 96913eb60f Fix both gclient_scm_test.py and scm_unittest.py.
Review URL: http://codereview.chromium.org/2425003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48637 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 50fd2bd734 Fix multiple tests on Windows.
BUG=23328
Review URL: http://codereview.chromium.org/2446001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48613 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 307d179455 Move all revision parsing code to _EnforceRevisions.
Make -r invalid@rev a warning and ignore the argument.
Make -r rev use the Nth solution.
Fix a bug in FakeRepos.assertTree().

TEST=updated the smoke test to reflect the new behavior which should be the most compatible with the current buildbot behavior
BUG=chromium-os:3465

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48607 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9e1da9e06d Fix a bad merge of gclient_smoke.py in my two last concurrent changes.
TBR=nasser

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48512 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 17cdf76123 Make FakeRepos more reusable.
Make it work with 'coverage'.
Make FakeRepos initialization lazy. Only generate the repository when needed. It's in part intended for gclient_scm_tests.py but I left it out of this review.

To use:
  easy_install coverage
  ./tests/gclient_smoke.py -c
  coverage report

Current coverage with gclient_smoke:

Name                        Stmts   Exec  Cover
-----------------------------------------------
gclient                       557    416    74%
gclient_scm                   496    270    54%
gclient_utils                 195    117    60%
scm                           439    180    41%
(ignoring irrelevant files)

It's quite good in fact, 74% of gclient.py being executed with the smoke test.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48501 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 918a9ae625 Add workaround to ignore the first solution specified with --revision solution@rev
TEST=new smoke test
BUG=chromiums-os:3465

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48490 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 62fd693347 Massive overhaul for gcl help
Automatically generate help and enforce stricter argument parsing.
Stops from throwing an exception when run outside a subversion checkout.
Fixed gcl lint.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48386 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 6b1d00b0d0 Add --deps support for revert, status and runhooks. Fix gclient status.
This may not make sense in practice but is necessary for testing. Add regression test.

TBR=msb
TEST=smoke test
BUG=23328

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48317 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 5fc2a33a78 Add more smoke test for gclient config and gclient revinfo.
BUG=23328

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48311 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 5ca2769d42 Reapply 48271 for the third time with fix.
"""
Enable automatic command and one-liner doc. Reformat pydoc accordingly.
Add parser as an argument and parse_args hook in preparation to move parse_args at the right place, inside the CMDxx functions.

R.I.P. gclient_test.py
"""
original code review at: http://codereview.chromium.org/2253002

In addition:
- Add more smoke tests: vars, hooks, runhooks
- Bugs filed about misbehavior with git checkout
- Fixed gclient runhooks

TEST=smoke test
BUG=23328

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48309 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8f041185af Revert "Reapply 48271 with fix."
Still broken.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48290 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3365c913c4 Reapply 48271 with fix.
"""
Enable automatic command and one-liner doc. Reformat pydoc accordingly.
Add parser as an argument and parse_args hook in preparation to move parse_args at the right place, inside the CMDxx functions.

R.I.P. gclient_test.py
"""
original code review at: http://codereview.chromium.org/2253002

In addition:
- Add more smoke tests: vars, hooks, runhooks
- Bugs filed about misbehavior with git checkout
- Fixed gclient runhooks

TEST=smoke test
BUG=23328

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48289 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 5434b4e20a Reverting last change, broke update.
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48272 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 096469fa69 Enable automatic command and one-liner doc. Reformat pydoc accordingly.
Add parser as an argument and parse_args hook in preparation to move parse_args at the right place, inside the CMDxx functions.

R.I.P. gclient_test.py

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48271 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3eac705726 Add real gclient_smoke tests now
gclient sync, revert and status are tested.

GClientSmokeGIT.testRevertAndStatus is known to fail since git-backed revert doesn't work.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48239 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 35fe9ada4e Use function decorator to simplify main()
Review URL: http://codereview.chromium.org/2198001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48225 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 83bea09ad2 Add basic gclient smoke tests.
The unit tests are unbearable and the next change forces me to trash them.
Thus adding smoke tests before. The current tests aren't involved enough yet but
are a good base for further testing.

I plan to only test the most important functionalities, the ones used in the continuous build and try server.

TEST=new smoke test
BUG=23328

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47580 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 1f440c497e Simplify a bit the gclient unit test
Review URL: http://codereview.chromium.org/2078011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47456 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ddff62df37 Goes further down the rabbit hole.
Enable automatic command and one-liner doc. Reformat pydoc accordingly.
Add parser as an argument and parse_args hook in preparation to move parse_args at the right place, inside the CMDxx functions.
Update unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47449 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a761b60c33 Fix unit test
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47437 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 7f5215d991 Update tests
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47435 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 1f7d1180cb Mode constants at their right places.
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47434 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 7c1a02b577 In the previous change, I forgot to update the unit test.
Review URL: http://codereview.chromium.org/2098009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47391 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 4c22d721d4 Refactor gcl.py to use a similar pattern for every commands.
The next step will be to generate help automatically and remove the command
check loop.

TEST=not much
BUG=me

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47291 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 28a5a52732 Makes trychange.py search harder for codereview.settings in a gclient checkout.
This fixes issues with Chromium OS checkout.

BUG=crosbug:3132.
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46761 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3c55d98111 Fix issue with svn copy/move directories.
svn diff would only generate a diff for modified files but the current code
would not respect full_move=True. full_move=True is necessary to make it work on
the try server.

TEST=svn move chrome chrome2; echo foo>>PRESUBMIT.py
The try job should fail but the diff should be right.
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46566 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org b2b4631780 Make gclient.git.revert reset to DEPS revision
BUG=http://crosbug.com/2897

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

Change-Id: I1398a349f1af728b593f0d4ea877831f25aed1f4

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46113 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 81e012ce41 Modify scm.GIT.GetUpstreamBranch to behave like git-cl.
It now defaults to origin/master when no branch is tracked.

TEST=git-try on untracked branch now doesn't result in an empty diff
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45935 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org d2e925611f Revert r45652 and r45653. It broke the single file export
feature.

TBR=piman,jamesr
Review URL: http://codereview.chromium.org/1730014

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