Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Unified Diff: gclient_scm.py

Issue 348703002: Remove hooks until Windows performance issues are sorted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 67d68674e04fd5f0c42084529551a1fa35c181f5..a9a3019b6d8af0e76b68c65d09a038369b0c957d 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -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:
« no previous file with comments | « no previous file | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698