Commit Graph

47 Commits (0c6b52b52e07ee69b54878d2c19d7e63e129bab4)

Author SHA1 Message Date
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
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 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
maruel@chromium.org fd87617b28 Standardize automatic retry and add a 15 seconds sleep to increase the chances of success
Review URL: http://codereview.chromium.org/1812001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46067 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a630bd7e2c Add a fallback to origin/trunk too when the branch is not tracked.
Raise an exception in case an upstream branch can't be found.
Fix an exception that was occuring just before when no upstream is found.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46011 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
sky@chromium.org 42d8da5831 Changes GetSVNBranch to prefer origin/HEAD over all others.
Review URL: http://codereview.chromium.org/1745009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45468 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
bauerb@chromium.org 838f0f28a5 Change |scm.GIT.GenerateDiff| and |scm.GIT.GetDifferentFiles| to ignore unmerged upstream changes.
Similar to r43313, this CL makes |git try| use the same patch that |git cl upload| uploads.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44097 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
sky@chromium.org d8da2c1053 Changes GetSVNBranch to prefer the first ref over the last. The
scenario I encountered was I've added another one of my machines as a
remote, and because we preferred the last ref my diffs were always
against my remote machine rather than local trunk. This change prefers
the first over the last. Another option would be to prefer something
like remotes/origin/trunk. Let me know what you think.

I've got a similar change to git-cl, but I'll wait until we agree upon
this before uploading that one.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44094 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
bauerb@chromium.org 14ec50401c Change scm.GIT.CaptureStatus to ignore unmerged upstream changes.
With this CL, the patch that is sent to the code review site includes only changes from the nearest common ancestor of the local and the upstream branch.

A diagram:

     /----B <- local branch
----A-----C <- upstream

Previously, the diff would be simply between C and B, whereas now it's between A and C, even if you update C.

This allows you to continously update origin/trunk without having to rebase/merge your local changes all the time, resulting in the need for less rebuilds.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@43113 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 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
maruel@chromium.org 8599aa7da2 Fix failure to contain the line entry instead of constant "True"
TEST=none
BUG=34793

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@38382 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 2de10250a2 Add automatic retry on HTTP 502 for svn and connection drop for git.
TEST=totally untested
BUG=34793

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@38336 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org b65040abbf Fix a FetchUpstreamTuple cwd bug
in_directory was not being set to the correct cwd. This caused commands to
always run in the dir from which gclient was executed.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37697 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org cd968c1833 Always return a tuple from GIT.Capture
Review URL: http://codereview.chromium.org/555198

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37685 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 0836c56149 Fix svn mv/cp/ren diff for real this time, for try jobs.
TEST=send a try job with a file moved with modified content
BUG=6825

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36828 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org d6504218f2 Update docs for git usage
chromium-os BUG=1189

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36129 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
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 54d1f1ae2f Abort gclient sync when a svn command fails.
TEST=a svn locked directory will stop a gclient sync
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35815 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0c4016967e Fixed wrong argument placement.
TEST=none
BUG=none
TBR=bradnelson

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35688 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ce3c8621ea Style fix.
TEST=none
BUG=none

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35685 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 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 c308a74419 Fix a typo in scm.GIT.GetBranch() and add --dry_run to trychange.py to ease testing.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35155 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 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 2185f0069a One liner fix.
Review URL: http://codereview.chromium.org/502075

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34984 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 b71b67e2aa Add an automatic retry on some svn commands.
Subversion's client just bails out too early too often.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32967 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 720d9f3c22 Fix path on Windows.
TBR=nsylvain

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32748 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
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
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 926ae6a75f Fix 2 recently introduced errors.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32058 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
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