Commit 8a13970e authored by szager@chromium.org's avatar szager@chromium.org

Remove hooks until Windows performance issues are sorted.

R=iannucci@chromium.org,hinoka@chromium.org
BUG=

Review URL: https://codereview.chromium.org/348703002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@278717 0039d316-1c4b-4281-b951-d872f2087c98
parent 108eced4
......@@ -308,6 +308,15 @@ class GitWrapper(SCMWrapper):
files = self._Capture(['ls-files']).splitlines()
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
def _DisableHooks(self):
hook_dir = os.path.join(self.checkout_path, '.git', 'hooks')
if not os.path.isdir(hook_dir):
return
for f in os.listdir(hook_dir):
if not f.endswith('.sample') and not f.endswith('.disabled'):
os.rename(os.path.join(hook_dir, f),
os.path.join(hook_dir, f + '.disabled'))
def update(self, options, args, file_list):
"""Runs git to update or transparently checkout the working copy.
......@@ -338,6 +347,9 @@ class GitWrapper(SCMWrapper):
if not revision:
revision = default_rev
if managed:
self._DisableHooks()
if gclient_utils.IsDateRevision(revision):
# Date-revisions only work on git-repositories if the reflog hasn't
# expired yet. Use rev-list to get the corresponding revision.
......@@ -796,11 +808,8 @@ class GitWrapper(SCMWrapper):
# git clone doesn't seem to insert a newline properly before printing
# to stdout
self.Print('')
template_path = os.path.join(
os.path.dirname(THIS_FILE_PATH), 'git-templates')
cfg = gclient_utils.DefaultIndexPackConfig(url)
clone_cmd = cfg + [
'clone', '--no-checkout', '--progress', '--template=%s' % template_path]
clone_cmd = cfg + ['clone', '--no-checkout', '--progress']
if self.cache_dir:
clone_cmd.append('--shared')
if options.verbose:
......
......@@ -1322,6 +1322,8 @@ class ManagedGitWrapperTestCaseMox(BaseTestCase):
def testUpdateNoDotGit(self):
options = self.Options()
gclient_scm.os.path.isdir(
os.path.join(self.base_path, '.git', 'hooks')).AndReturn(False)
gclient_scm.os.path.exists(self.base_path).AndReturn(True)
gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.os.path.exists(os.path.join(self.base_path, '.git')
......@@ -1350,6 +1352,8 @@ class ManagedGitWrapperTestCaseMox(BaseTestCase):
def testUpdateConflict(self):
options = self.Options()
gclient_scm.os.path.isdir(
os.path.join(self.base_path, '.git', 'hooks')).AndReturn(False)
gclient_scm.os.path.exists(self.base_path).AndReturn(True)
gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.os.path.exists(os.path.join(self.base_path, '.git')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment