Commit Graph

333 Commits (5a2fefb9ebf89806b6b6a5aeead5dad5855fc476)

Author SHA1 Message Date
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
piman@chromium.org 6f36372433 patch from issue 1640001
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45652 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org f0379d1642 Fix broken unit test by r44612.
TEST=unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45593 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
piman@chromium.org 54c3a7e9ad TBR: jamesr
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44871 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
piman@chromium.org 8b5086d8d5 Add -j option to gclient to run parallel updates
On a chromeos checkout, -j 10 brings down null sync time from 2 minutes to 16 seconds
Currently -j may break some assumptions about ordering of commands (which may be fine for some clients, but not all), so it's not on by default.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44869 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org 5756466130 Fix File() to work with SVN 1.4 by using svn export in place
of svn co --depth.

This should work even if you change svn versions between gclient syncs.
Review URL: http://codereview.chromium.org/1560029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44441 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org 30ef9ae362 Extend From() to allow importing from different mappings. Also
allow From() to import when the URL is relative.

For example, if src/DEPS is:
deps = {
  'base' = 'svn://svn/base@123',
  'main' = From('base', 'src/main'),
}
and base/DEPS is:
deps = {
  'src/main': '/main@100',
}

This will checkout svn://svn/main@100 in main.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44044 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org e41f682751 Workaround output variance in pprint.pformat.
TEST=fix unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@43952 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org 4b5b1779fb Add the ability to check out a single file from a repo.
The syntax is:
deps {
  'path': File('http://svn..../path/file@42')
}

This will checkout a single file and use scm.update to
keep it up to date.

See https://bugs.webkit.org/show_bug.cgi?id=36578#c7 for a
description of why I want to add this.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@43911 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
thomasvl@chromium.org e52990120b Allow the existence of ~/.gcl_upload_no_try override the default of try on upload.
Review URL: http://codereview.chromium.org/1619005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@43854 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
iposva@chromium.org 8cf7a39100 Provide a way to name a solution as part of the config command.
Review URL: http://codereview.chromium.org/1611009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@43847 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org eea4dfbe32 When the tree is closed, it's closed.
Convert the warning to error.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@42572 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org 5d63eb8382 revinfo: Properly use git HEAD or svn BASE revisions
BUG=http://crosbug.com/1658

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@42555 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3fbcb08a1d Add new canned checks: CheckRietveldTryJobExecution and CheckBuildbotPendingBuilds
These are the same that the one in chromium's src/PRESUBMIT.py but slightly more
resilitent to exceptions.
Empirical studies have shown that exceptions in presubmit checks result in
disorientation and lack of willingness to commit.

TEST=OMG new unit tests!

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@42102 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org fb11c7b98d Add input_api.json to presubmit checks.
Review URL: http://codereview.chromium.org/1116001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@41973 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 55e724e8fe Stop SVNWrapper and GitWrapper from inheriting from scm.SVN and scm.GIT.
This simplifies the unit tests and clarify what is what.

Ran pychecker on a few files.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@41310 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org d0f854af68 Extract git version check code from gclient_scm.py into scm.py where it belongs.
Review URL: http://codereview.chromium.org/878001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@41308 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
jam@chromium.org 83b6e4ba08 Add ability to specify that all issues are pivate in codereview.settings
TBR=maruel
Review URL: http://codereview.chromium.org/702001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@40992 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org d90ba3f136 sync @branchname git support
Also improve GIT.update error handling and verbosity levels

TEST=unit tests
BUG=http://crosbug.com/480
BUG=http://crosbug.com/1136

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@39717 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
davemoore@chromium.org 8bf2731ded Forgot to include the test change.
Review URL: http://codereview.chromium.org/650039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@39458 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ba55177642 Fix licensing headers and move most third party code to third_party/
Moved tests/pymox to third_party/pymox
Moved upload.py to third_party/upload.py
Fixed tests so they can run standalone
Fixed the executable bit on some scripts

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37987 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 7be5ef2ed0 Change CheckCall behavior when print_error=False
We now return the stderr half of the tuple.
This required a clean up of any usage of CheckCall and GIT.Capture.

Patch contributed by Nasser Grainawi <nasser@codeaurora.org>

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37650 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 56ca2c246c Remove stale revert.py unit test and fix another test I broke in r37487.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37618 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b9e7adaa82 Add presubmit_canned_checks.CheckLicense()
It does a regexp search on the file contents to make sure it contains expected license boiler plate.

It is a generalization to implement the equivalent of ubuntu's license check script into the corresponding PRESUBMIT.py files.

TEST=unit tests
BUG=28291

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37338 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org e4af1ab4cf gclient: Add better error reporting when path is not a git repo.
Review URL: http://codereview.chromium.org/505007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36172 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org e6f78352a7 gclient: git relative url implementation
Redo relative url implementation per maruel's comments here:
http://codereview.chromium.org/500015

Instead of adding an option, implement relative urls differently for
git urls.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36126 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org 32906d1bce gclient: fix unittests
Review URL: http://codereview.chromium.org/550013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36022 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8ede00e1af Add the capability to filter out files on try job with regexp.
By default, filters out 'ChangeLog'. A pain directly coming from Webkit.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36008 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
mhm@chromium.org c2190cb26c Allow git-try to try rietveld changes directly.
Some external contributors need their CL's try'd quickly, but currently its not easy unless we patch locally. This will allow you to submit the rietveld issue number and will do the rest automatically. As well, renable the dry_run option. It was removed. 

BUG=None 
TEST=git try --issue 12345
Review URL: http://codereview.chromium.org/481006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35881 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org fd9cbbb7c4 Fix case sensitivity issues and svn move patches for --sub_rep on Windows.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/538009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35839 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 40f35c3268 Fix unit tests (mostly esthetical)
TEST=none
BUG=none
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35767 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 1c7db8e6ee Add "diff against" support when sending try patches.
This is mostly useful with git when diffing against arbitrary branches.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35684 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 01d8c1d113 Fix checkout root detection for git.
Add shorthand parameters.

Stop changing the logging level in gcl and some logging changes.

Change SCM.GetCheckoutRoot() to SCM.checkout_root.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35683 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b6d36495b5 Add back automatic fallback to svn access when http access fails.
It was somehow ripped out by accident.

TEST=none
BUG=none
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35284 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org d9141bffa4 After much refactory, finally add significant functionalities to trychanges.py
Add real logging support.
Fix the patch path mungling that was broken earlier.
Add and proper refactor automatic gclient and gcl settings detection.
Factored so it is possible to add other autodetection algorithms.
Now works standalone in hybrid svn&git checkouts within a gclient meta-checkout.

TEST=bah
BUG=none
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35218 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ee4071d443 Add gclient_scm.GitWrapper.pack()
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35177 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org f7ae6d550e Add --sup_rep support to trychange.py.
This adds the functionality to try a job spread across multiple checkouts.

TEST=fixed unit tests and tested with hybrid svn-git checkouts
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35168 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3ccbf7e6b7 Factor out PathDifference into gclient_utils for a later reuse.
Make lack of email address an error.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35167 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a93717670e Add full_move flag to GIT.GenerateDiff and Factor out FindGclientRootDir into gclient_utils.
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35154 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b24a8e1a5a Remove more logic out of trychange.py into scm.py.
The goal is to (almost) completely remove git-try.

TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35144 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org f2f9d554d4 Move GenerateDiff into a common function.
Fix standalone trychange usage on both svn and git.
Remove implicit dependency on git-cl.

TEST=unit test

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35121 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ea8c1a9bc9 Make breakpad, gcl and presubmit_support dependencies optional
TEST=unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35072 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 1811135923 Remove gclient-specific hacks from trychange into gcl.
Remove upload dependency.

This is towards making trychange.py work mostly standalone for the webkit try server.

TEST=unit tests and tested both gcl try and git-try.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35071 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 94b1ee9dbd Factor out gcl.GetRepositoryRoot() into scm.SVN.GetCheckoutRoot()
This is to reduce trychange.py dependency on gcl.py

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35055 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9a2f37eaf1 Remove trychange.RunCommand and replace it by gclient_utils.CheckCall.
TEST=unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35052 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0fca4f3746 Get rid of gcl.ReadFile.
Review URL: http://codereview.chromium.org/501106

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34950 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org fc83c11b37 Remove gcl.WriteFile
Review URL: http://codereview.chromium.org/502066

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34949 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org c532e17e1b gclient: implement a less hacky relative URL implementation
Doing something like basename when concatenating base_url with
relative url.

Added use_relative_urls2 to enable switching between old
implementation and new implementation. Once the old implementation
is deprecated we can remove the use_relative_urls2.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34563 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org 5bde485307 gclient: Add better error reporting and handling when there is a rebase conflict
When a rebase generates a conflict, report an error and exit immediately.
If in an existing conflict (no branch), report an error and exit immediately.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34459 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org e8dd16c701 gclient: Fix unittests
Review URL: http://codereview.chromium.org/486045

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34415 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 63ebf04df5 Fix the way the temporary directory is created.
It is much cleaner and works for cases where the directory is not writeable.

Also fix an unrelated unit test.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34080 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
chase@chromium.org 37c629a3b1 Call git diff --name-status with a relative path.
On a new Linux box, during git cl dcommit I observed
the error:

  fatal: invalid diff option/value: -r

This was caused by the git cl presubmit hooks running:

  git diff --name-status -r refs/remotes/origin/trunk.. /path/to/src

By passing a relative path (given by git rev-parse
--show-cdup) instead of an absolute path for
/path/to/src, git diff --name-status does not print an
error and returns the expected list of changed files.

Also fix some broken scm and gclient_scm unit tests.

BUG=none
TEST=git presubmit hooks work from main working
directory
Review URL: http://codereview.chromium.org/438012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32999 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
chase@chromium.org ea452b3f54 Avoid losing CL description during Rietveld outage.
Save the CL locally prior to attempting to submit
to Rietveld.  The CL is saved locally with a dirty-bit
before the upload is attempted.  If successful, the CL
is saved locally again with a clean-bit.

On loading a dirty CL for editing, we only load the
CL description from Rietveld if the local CL is clean
(there are no pending changes to upload).  Clean CLs
continue to retrieve updated descriptions directly
from Rietveld.

BUG=none
TEST=gcl change <name> saves CL description local
prior to uploading.  gcl change <name> after a failed
Rietveld upload uses local CL description instead of
using the associated issue's description from Rietveld.
Changes in this state are reset to the 'clean' state
after the Rietveld update completes.
Review URL: http://codereview.chromium.org/428001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32791 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org c78f246ee4 Add scm.*.GetEmail() to retrieve the user email. Use this email for try job emails.
TEST=not much
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32720 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org b9f2f6236b gclient: fix bug in parsing ssh urls
Review URL: http://codereview.chromium.org/402105

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32568 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org a4d60f9bf3 Fix parsing bug in SplitUrlRevision.
ssh://example.com/git/test.git was not parsed correctly.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32377 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5aeb7dd54c Reapply 32057, 32058, 32059, 32062 and fixes problems introduced by these changes.
Noteworthy change is scm.SVN.GetFileProperty calls Capture instead of Run.

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32181 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
erg@google.com 26970fa907 - Add a presubmit check that lints C++ files (will submit CLs that
add this to PRESUBMIT.py in the chromium tree later).
- Update cpplint.py to the latest version from the style guide.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32180 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 261eeb5e93 Revert 32057, 32058, 32059, 32062 because they still have unwanted side-effects.
Revert "Group SCM-specific functions in classes to simplify generalization of the interface."
Revert "Fix 2 recently introduced errors."
Revert "Fix a variable aliasing error."
Revert "Fix typo."

TBR=dpranke
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32065 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 85a3192f9c Group SCM-specific functions in classes to simplify generalization of the interface.
TEST=none
BUG=none

Move scm functions into a class to make it simpler to manage.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32057 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org ac915bb6af gclient: fix another bug where ssh urls weren't parsed correctly
ssh://test@example.com wasn't being parsed correctly for revinfo.

Fixed by factoring out all code which splits url into a base_url
and revision.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31910 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org d5800f1996 Split scm-specific functions out of gclient_scm.py to scm.py.
Reapplies r31809 is typo fixed.

TEST=unit tests fixed and reclassified
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31812 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 0563d6c747 Revert "Split scm-specific functions out of gclient_scm.py to scm.py."
This reverts commit 7489404c56dcc725c7c13214f410b2d375a6630a.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31810 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 8ce0a13a85 Split scm-specific functions out of gclient_scm.py to scm.py.
TEST=unit tests fixed and reclassified
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31809 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 2dfc8ee713 Fix unit tests on Windows.
Removed lines in the process.

TEST=unit tests
BUG=none
Review URL: http://codereview.chromium.org/387033

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31759 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 8ef5f54e4d Cleanup the unit tests by mocking more system functions.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31754 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 57ec90d46d Cleanup the test and fix mocks. Workaround pprint flakiness.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31593 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e3608dfc1a Run pychecker over most scripts in depot_tools. Catched a few bugs.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31590 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org 0f282063d9 gclient: Make revinfo work on git.
* Add revinfo as part of SCMWrapper interface.
* Implement revinfo for git and svn.
* Add unit tests.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31280 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
dpranke@google.com 5cc6c57bf5 Fix output reordering when you get a conflict on an update.
If you're not running gclient sync with --verbose and you get a conflict on
a file, the conflict message prints *before* the message that you're running
update in the appropriate directory. This is happening because we intercept
stdout but not stderr, and the conflict prompt goes to stderr. redirecting
stderr in the popen() to the pipe fixes this.

  R=maruel@chromium.org
  BUG=none
  TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31276 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
dpranke@google.com e72bb63e3e Revise change in r30415 to properly climb local directories looking for a
modified codereview.settings or presubmit file.

  BUG=none
  R=maruel@chromium.org
  TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@30503 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
dpranke@google.com bb816387a8 Modify gcl lint to use regexes to figure out which files should be linted.
I've added two settings to codereview.settings - LINT_REGEX and 
LINT_IGNORE_REGEX - to specify which files should be linted. The default
is to lint anything that ends in .cpp, .cc, .inl, or .h, and to ignore 
nothing.

I have also modified GetCachedFile() to look for a locally modified version 
of codereview.settings before looking in the repository.

  R=maruel@chromium.org
  TEST=none
  BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@30415 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
dpranke@google.com 22e29d4ec5 Make 'gclient update' and 'gclient status' quieter by default - they don't
print messages unless the underlying commands actually generate output.
This is a more conservative version of r28271.

  BUG=none
  TEST=none
  R=maruel

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@30296 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e959791851 Add pymox, fixed non-deterministic pprint.pformat output expectation.
pymox auto-checkout never really worked well so check-in pymox directly.

pprint.pformat is non-determinist in one test. Worked around the issue.

TEST=unit tests
BUG=none
Review URL: http://codereview.chromium.org/266043

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@29398 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org ea6c2c5cea Fix depot_tools unit tests on Windows.
TEST=unittests
BUG=none
Review URL: http://codereview.chromium.org/273010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28591 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
gspencer@google.com efb9450e27 This makes presubmit queries accept "yes" as well as "y"
as an answer.
Review URL: http://codereview.chromium.org/268023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28557 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 7753d24625 Revert "Un-revert the reverted 28058, so that we get quiet again."
This reverts commit 28058.

BUG=24081
TEST=gclient sync without --force is not working anymore.
TBR=dpranke

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28271 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
dpranke@google.com 2a6e20ca4a Un-revert the reverted 28058, so that we get quiet again.
BUG=none
  R=maruel
  TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28185 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
thestig@chromium.org de24345ee7 Make the try slave selection client side.
BUG=23071
TEST=none
Review URL: http://codereview.chromium.org/248029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28155 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
chase@chromium.org 8e416c83a8 Git support in presubmit tests.
Expand presubmit_support and gclient_scm to support
getting basic status and changed files from a Git
checkout.

BUG=5339
TEST=presubmit_support.py works from a git checkout,
gcl presubmit works from a svn checkout
Review URL: http://codereview.chromium.org/242140

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28092 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 9344e97ada Revert "Modify the output of gclient update, gclient status to only print out"
Its side-effect caused tree breakages, at least on the try slaves.

TBR=dpranke
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28058 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
dpranke@google.com 1a77f1dc15 Modify the output of gclient update, gclient status to only print out
messages when --verbose is specified or when something actually happens.

Also, remove --manually_grab_svn_rev, because we need this to happen all 
the time to get gclient update to shut up if we're comparing against HEAD.
It doesn't look like there are any real side effects of removing this.

An alternative change would be to wrap this behind a --quiet flag.

Note that the change to tests/trychange_unittest.py is an unrelated fix to get
all the tests to pass.

  R=maruel@chromium.org
  TEST=none
  BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28039 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
chase@chromium.org ad02011773 Fix trychange unittest.
BUG=none
TEST=trychange unittest passes
Review URL: http://codereview.chromium.org/243090

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@27969 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org ab27b8ed66 gclient: fix unittests
Review URL: http://codereview.chromium.org/254012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@27492 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org e28e498655 gclient_scm: add support for .git
gclient_tests: add GitWrapper test cases

gclient_scm: make RunGit private and add url check

gclient_scm: add revert, run_hooks, and status

gclient_scm: add git implementations of cleanup, diff, and export

gclient_scm: implment GitSCM::update

gclient_scm: add a checks for unsupported scm and unimplemented method

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@27241 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org cb5442bf76 gclient_scm: add test for unsupported scm
gclient_scm: use a map for deciding whether or not the scm is supported

gclient_scm: add a checks for unsupported scm and unimplemented method

git_scm: pull out svn code into SVNWrapper

gclient_scm: create a create_scm factory method

Use a factory method to abstract SCMWrapper creation. This method
will eventually return the correct subclass of SCMWrapper. Initially,
there will only be SVNWrapper.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26823 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5a180bb854 Implement fixes requested in review http://codereview.chromium.org/215039
TBR=nsylvain
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26806 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org c13c5ff5a4 Fix gclient unittests.
BUG=none
TEST=unittests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26804 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5e73b0cfa1 Revert "Use a factory method to abstract SCMWrapper creation." totally broke gclient.
TBR=msb
TEST=none
BUG=none

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


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26606 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@chromium.org 56237087e9 Use a factory method to abstract SCMWrapper creation.
This method will eventually return the correct subclass of SCMWrapper. Initially, there will only be SVNWrapper.

gclient_scm: add test for unsupported scm

gclient_scm: make SCMWrapper constructor parameters non-optional

gclient_scm: add a checks for unsupported scm and unimplemented method

git_scm: pull out svn code into SVNWrapper

gclient_scm: create a create_scm factory method

TEST=
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26602 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
msb@google.com b75db5152a gclient_scm: add test to catch bug fixed by r208010
Review URL: http://codereview.chromium.org/214017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26577 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org c2c78f7f02 Add a new test case for SCMWrapper.revert.
Add a test case for the UnversionedUnexpected file code path.

TEST=This test case will catch the bug fixed by r26425.
BUG=none

Patch contributed by msb@

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


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26458 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
robertshield@google.com 0d3c7a868b Add missing import from r26426.
BUG=gcl try and gcl upload don't work
TBR=maruel

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26429 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5f3eee3bab gclient: remove wildcard import from git_scm
Part of a larger refactoring to abstract SCM-specific bits.

presubmit_support, revert, gcl: modify to import gclient_scm and gclient_utils

Part of a larger refactoring to abstract SCM-specific bits.

revert, gcl: modify to import gclient_scm and gclient_utils

Part of a larger refactoring to abstract SCM-specific bits.

gclient: pull out SCM bits

Pulled out SCMWrapper into gcliet_scm.py as part of a larger refactoring to
abstract SCM-specific bits. Plan is to evenutally add git support.

Pulling out SCMWrapper also required pulling out utility functions into
a gclient_utility.py.

Patch contributed by msb@

TEST=none
BUG=none


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26423 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
kbr@google.com ab318594b3 Added "gclient pack" subcommand, which generates a patch relative to
the root of the source tree. It is similar to "gclient diff", and
shares much of the implementation, but it seems that developers may
want the semantics of each in different situations, which is why it is
being added as a new command.

Generalized SubprocessCallAndCapture into SubprocessCallAndFilter.
Added RunSVNAndFilterOutput; changed RunSVNAndGetFileList to use it.
Fixed problem in presubmit_canned_checks.py where it was not working
on Windows. Updated unit tests for gclient.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@25410 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
chase@chromium.org 0e433add67 Add 'time' to list of actual members.
This fixes the presubmit unit test.

BUG=none
TEST=presubmit tests pass
Review URL: http://codereview.chromium.org/173245

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@24059 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
thestig@chromium.org da8cddddfe Add a presubmit check for accidental checkins of files under a SVN modified directory.
Review URL: http://codereview.chromium.org/155489

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@23271 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
pam@chromium.org f0dfba3f44 Add all modified files to new changelists by default.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/164084

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@22800 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
estade@chromium.org bfd09ce886 Get rid of annoying empty changelists!
1) don't save empty changelists to begin with. This guards against an accidental or canceled "gcl change" creating an empty file.
2) create a "clearempties" command which clears all changelists that don't have any files in them.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@22538 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
evan@chromium.org 67820efbf0 Add a --nohooks to gclient to update/sync/revert without calling the hooks
BUG=16856

Patch from Fabien Tassin <fta@sofaraway.org>.


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@21655 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
phajdan.jr@chromium.org 644aa0cfaa Add export command to gclient.py
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@20990 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago