This is a serious bug, if a version is unpinned, it would become stuck at
whatever a local branch 'master' may point to. This is extremely bad when a
pinned dependency is unpinned on purpose, for example on a canary master. We
reproduced this problem on the chromium.swarm master by setting a custom_vars
swarming_revision to '', which then stopped syncing at the expected
origin/master commit but instead got stuck to what happened to be a local master
branch.
This happens on git dependencies if the main solution is using svn. This doesn't
happen on git checkouts using .DEPS.git due to bug 323233.
The issue looks like:
________ running 'git reset --hard HEAD' in '/path/src/tools/swarming_client'
HEAD is now at 4727bd5 Some commit
Checked out revision d908a546e28d1e9f85f5690cf6c3a080f06ba711
Note that HEAD and what is checked out do not match.
Also reduce the hardcoding of 'origin' by creating a variable named 'remote'.
R=petermayo@chromium.org
BUG=322961
Review URL: https://codereview.chromium.org/85473007
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@237332 0039d316-1c4b-4281-b951-d872f2087c98
This helps prevent timeout when checking out large repositories (like blink)
using the git cache_dir.
R=iannucci@chromium.org, maruel@chromium.org
BUG=295119
Review URL: https://codereview.chromium.org/43273005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@231111 0039d316-1c4b-4281-b951-d872f2087c98
Add retry for all git operations that speak to a remote. This
should smooth out issues with the git/gerrit-on-borg service.
Review URL: https://codereview.chromium.org/26234004
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@229219 0039d316-1c4b-4281-b951-d872f2087c98
This fixes an error if the branch already exists.
Review URL: https://chromiumcodereview.appspot.com/24360009
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@225278 0039d316-1c4b-4281-b951-d872f2087c98
This is in order to support 'features' like got_revision for build systems
unwilling to scrape the human-readable output of gclient in order to extract
basic information :)
R=agable@chromium.org, maruel@chromium.org
BUG=265618
Review URL: https://chromiumcodereview.appspot.com/23753008
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@225046 0039d316-1c4b-4281-b951-d872f2087c98
This solves a problem with "os.rename" sometimes failing with an
exception after cloning a dependency to a temporary directory. It's
possible the dying git processes still hold a handle to the directory.
Since gclient delete the temporary directory regardless of the success
of the process, it results in a lot of GB downloaded for nothing.
SafeRename solves this by retrying a few times if the renaming fails,
sleeping one second every time to get other processes the time to
release their lock on the directory. It gives up retrying after 15 times.
BUG=
R=maruel@chromium.org
Review URL: https://chromiumcodereview.appspot.com/23875041
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@224372 0039d316-1c4b-4281-b951-d872f2087c98
Add an option in DEPS files to clone a project into a temp dir
and then copy into expected final dir. This allows checking out a
git repo into a folder which is non-empty. It is useful for projects
that are embedded in src/ but want to specify the revision of
src/ in the embedded project (such as android private).
BUG=165280
Review URL: https://chromiumcodereview.appspot.com/19359002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@212720 0039d316-1c4b-4281-b951-d872f2087c98
Also open the altfile with 'w' because we assume ownership over the object
alternates. The logic to correctly support other alternates would be quite
complex, so don't even imply support.
R=maruel@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/19777004
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@212426 0039d316-1c4b-4281-b951-d872f2087c98
This caused problems for repo-based projects that need to install the
standard Change-Id commit-msg hook.
With the commit-msg hook gone, we can also reinstate the --template
argument to 'git clone'.
BUG=235215
R=iannucci@chromium.org, ilevy@chromium.org, maruel@chromium.org
Review URL: https://codereview.chromium.org/18083033
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@211464 0039d316-1c4b-4281-b951-d872f2087c98
Forcing function for developers to create a .netrc file.
BUG=
Review URL: https://codereview.chromium.org/18949002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210686 0039d316-1c4b-4281-b951-d872f2087c98
timer, i.e. ~900 seconds.
This should at least help make 'fetch chromium' slightly more reliable
over somewhat slow connections.
BUG=230691,247173
R=rogerta@chromium.org
Review URL: https://codereview.chromium.org/18150002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210190 0039d316-1c4b-4281-b951-d872f2087c98
This enables significant time savings, especially since file_list only exists to
enable file-specific hooks (which, AFAIK, nothing actually uses). On a z620
(linux) using the cached git repos, a first-time `gclient sync --nohooks` takes:
* (with) 131.06s user 14.10s system 117% cpu 2:03.89 total
* (without) 482.13s user 189.35s system 144% cpu 7:45.63 total
This change makes nohooks cause file_list to be None if we don't need to
accumulate it, and updates GitWrapper and SvnWrapper appropriately.
R=szager@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/18541006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210026 0039d316-1c4b-4281-b951-d872f2087c98
Instead of cloning straight into place, clones are made to a global cache dir,
and then local (using --shared) clones are made from the cache to the final
resting place. This means the 'final' clones are full repos with no shenanigans,
meaning that branches, commits, etc. all work, which should allow the rest of
the gclient ecosystem to work without change as well.
The primary benefit is, of course, reduced network IO, and a much lower cost for
'clobber' operations (assuming we don't clobber the cache). It also means that
a given bot can have a greater number of checkouts, since the entire git history
will only be stored once per machine, instead of once per checkout.
R=dpranke@chromium.org, szager@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/18328003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210024 0039d316-1c4b-4281-b951-d872f2087c98
- Use config --local for properties that should be local.
- Remove git fetch retry logic, it should not be necessary
with the googlesource hosts.
- Include .strip() in GIT.Capture, simplifying other calls.
- Safer testing of whether dep revision is a sha.
- Fix refs/remotes/ DEPS branch detection
Review URL: https://chromiumcodereview.appspot.com/18262002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@209825 0039d316-1c4b-4281-b951-d872f2087c98
This will be used on the bots when calling apply_patch, which commits to git
repos.
R=dpranke@chromium.org,szager@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/18006002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@209040 0039d316-1c4b-4281-b951-d872f2087c98
As noticed in the TODO, raw_input (used by ask_for_data) works badly
on background threads. On my Windows it doesn't even print the prompt which
makes it hard to interact with it.
Better to just abort and tell the user of gclient how to proceed.
BUG=
Review URL: https://chromiumcodereview.appspot.com/15421005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@201295 0039d316-1c4b-4281-b951-d872f2087c98
Allow users to set a git config entry which stops
gclient from messing with remote.origin.url. Useful
for using experimental repos.
Review URL: https://chromiumcodereview.appspot.com/14731015
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@199532 0039d316-1c4b-4281-b951-d872f2087c98
The 'RemoveDirectory()' function in gclient_utils is deprecated and
rmtree() should be used instead for consistency.
This patch modifies all clients in depot_tools to use rmtree() instead
and removes the RemoveDirectory function.
+ The SVNWrapperTestCase.testRevertNoDotSvn() mocking
expectation has been slightly changed. This was required
because the test invokes code that used to call
gclient_utils.RemoveDirectory() directly, while only
gclient_utils.rmtree() was mocked.
BUG=NONE
R=maruel@chromium.org, ilevy@chromium.org
TEST=manually run gclient_utils_test / gclient_smoketest / scm_unittest / gclient_scm_test
Review URL: https://chromiumcodereview.appspot.com/14134010
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@196133 0039d316-1c4b-4281-b951-d872f2087c98
This is a bit of future-proofing. The git hooks in depot_tools/git-templates/hooks all try to forward to build/git-hooks.
Currently, the only actual hook we have is in src/build/git-hooks/pre-commit, which (usefully) makes sure no one inadvertently commits a submodule change. If we want to add more git hooks, we can simply commit them to build/git-hooks, rather than asking everyone to modify .git/hooks in their checkout.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/14230012
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195336 0039d316-1c4b-4281-b951-d872f2087c98
This allows the branch-heads to be pulled even if not configured on the
original clone.
Review URL: https://codereview.chromium.org/13951009
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194382 0039d316-1c4b-4281-b951-d872f2087c98
This was causing extremely slow gclient sync's, and was preventing gclient from
outputting anything if a slow submodule needed significant updating.
R=cmp@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/13702002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@192475 0039d316-1c4b-4281-b951-d872f2087c98
This reverts commit 6a2e4710bf.
cmp says:
This CL causes NewGit and Git submodules workflows to comingle in ways that result in bad and unexpected failures for new and existing users. One failure is for the new Blink developers who need to use git-svn with their WebKit third_party checkout. Another failure is in the Windows NewGit workflow where gclient sync takes longer than necessary to complete.
The right approach at this point given the costs of this change is to revert it and rethink the best way to get projects the functionality they need while restoring the functionality existing projects have required for over a year now.
Please discuss the recursive/recurseSubmodules code face-to-face with cmp@google.com before attempting to make this live again. Thanks.
R=cmp@chromium.org
BUG=224074
Review URL: https://chromiumcodereview.appspot.com/13470027
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@192236 0039d316-1c4b-4281-b951-d872f2087c98
This causes the 'git config' to only add or update the branch-heads fetch
entry, and not replace any other existing entry (e.g. refs/heads/*).
Review URL: https://chromiumcodereview.appspot.com/12634013
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@189326 0039d316-1c4b-4281-b951-d872f2087c98
Some versions of git don't support 'clone --config'.
Review URL: https://codereview.chromium.org/12688005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@187296 0039d316-1c4b-4281-b951-d872f2087c98
Some SVN-only trybots get errors when running gclient revert with this
change. I assume it's because the flag is not present for the gclient
revert command, and that the code checking if options.with_branch_heads
is set is common to both revert and sync.
BUG=none
TEST=reverted locally and gclient revert worked again.
Review URL: https://chromiumcodereview.appspot.com/12616006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@186967 0039d316-1c4b-4281-b951-d872f2087c98
The "branch-heads" are refspecs created from upstream svn branches. This flag
is mostly needed for official builders, and adds about 1/2GB of data to the
checkout, so not currently enabling by default.
Review URL: https://codereview.chromium.org/12546017
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@186598 0039d316-1c4b-4281-b951-d872f2087c98
Currently, if an unversioned directory is present where we would expect
a versioned repository to be, the following error is printed:
Can't update/checkout %s if an unversioned directory is present.
Delete the directory and try again.
If --reset and --delete_unversioned_trees are used, gclient should delete
the unversioned directory in this case.
This problem can be reproduced using the following recipe:
$ rm -rf src/third_party/webrtc/.svn
$ gclient sync -nRftD
BUG=none
TEST=Verify that above error is fixed. Run all smoke tests.
Review URL: https://chromiumcodereview.appspot.com/11366239
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@167942 0039d316-1c4b-4281-b951-d872f2087c98
Takes into account the new submodule-enabled repository layout.
Review URL: https://codereview.chromium.org/11098064
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@161403 0039d316-1c4b-4281-b951-d872f2087c98
The try slaves run 'git revert' to clean up from the previous run. This only runs 'git reset --hard', which does not remove any untracked files, so if a CL adds a new file it will still be present after 'gclient revert'. Adding git clean -f -d removes untracked files (-f) and directories (-d).
Review URL: https://chromiumcodereview.appspot.com/10986032
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@159020 0039d316-1c4b-4281-b951-d872f2087c98