Commit Graph

547 Commits (707c1487c47e10d6d1e6d4658fa0849847331d4b)
 

Author SHA1 Message Date
maruel@chromium.org 707c1487c4 Fix the array format for the gcl diff with no change list case.
TBR=nsylvain

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48755 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org c0b8a4ecb9 Add shorthand to many flags
Review URL: http://codereview.chromium.org/2455008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48738 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
nsylvain@google.com 38729704f0 Fix broken "gcl diff cl" command. We need to use full paths, not
relative path. 

bug:45589
Review URL: http://codereview.chromium.org/2447002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48680 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 1e3b8f0d0c Certain versions of python for Windows don't support epilog in the constructor.
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48610 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 d089192b11 More examples at the end of trychange.py help and move the -R flag to the right group
Review URL: http://codereview.chromium.org/2408001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48606 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 58a7c7d3e3 Some weirdo folks have @ in their USER environment variable. Strip it off.
Review URL: http://codereview.chromium.org/2336002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48582 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org e56fe82c45 Fix argument checking in gcl.py
Otherwise, commands like "gcl commit" would throw an exception instead of a comprehensible error message.

TBR=jam

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48520 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 86c0dec826 Add --deps for all commands beside config and help. Fix help.
Review URL: http://codereview.chromium.org/2384001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48508 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
nasser@codeaurora.org d0fd5f0d80 Fix gclient revinfo
Review URL: http://codereview.chromium.org/2380001

Change-Id: Icfef43fe507be04b8c178440834d26b9ac3ced77

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48489 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b109e6a567 Ignore case in tree status check
BUG=chromium-os:2308

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48488 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ce921b2023 Use https for stack trace upload.
Add an explicit Register() function to be called outside of this file.
Send the host fqdn to help know from where the exception comes. It is useful when a build slave throws an exception.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48455 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a8e36cbb3a Fix a typo
TBR=jam

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48449 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ab89d6f286 Use getfqdn() instead of gethostname()
Otherwise it would return the naked host name most of the time, especially on Windows.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48432 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 4357af2ece Fix typo in CMDcommit.
TBR=siggi

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48396 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 35f08156cb Quick fix for gclient revert.
I'll add a smoke test after.

TBR=msb
TEST=to be written later
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48314 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 ff6cf0e5b8 gcl commit must accept additional arguments.
TBR=jam

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48235 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
scherkus@chromium.org 95f0f4eb86 Strip the subversion revision when passing it as an argument to --revision.
Turns out svn treats extra whitespace as part of the revision number and throws an exception.

BUG=44790
TEST=insert some spaces in your revision arguments, gclient should still work
Review URL: http://codereview.chromium.org/2077017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47979 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 4d9da40423 When branch is not correctly set, it would throw an exception.
Review URL: http://codereview.chromium.org/2087015

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47678 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
evan@chromium.org 400f3e7090 Prevent git from using any external diff program that may have been
configured for it when figuring out the patch to upload to the try
server.  This prevents git installations where the diff is configured
to use an interactive tool to work without doing nasty workarounds.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47661 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 491c04b1ea Run pychecker and caught some issues
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47436 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 258d17f296 Fix SCM.ReadRootFile when self.gclient_root is not yet defined
Review URL: http://codereview.chromium.org/2102004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47426 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 e9e2223e6e Remove unneeded args of args that are the default value anyway.
Less text = better readability.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47389 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 6386ccb236 Fix a logic error.
TBR

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47373 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 79692d64d8 Remove redundance in the documentation.
Make the documentation more manageable and use automatic function discovery.

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

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