Commit fd5b6382 authored by agable@chromium.org's avatar agable@chromium.org

Remove git_filter=True from git cache_dir commands.

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
parent d6ddc1cb
...@@ -801,8 +801,7 @@ class GitWrapper(SCMWrapper): ...@@ -801,8 +801,7 @@ class GitWrapper(SCMWrapper):
cmd += ['--reference', os.path.abspath(self.checkout_path)] cmd += ['--reference', os.path.abspath(self.checkout_path)]
self._Run(cmd + [url, folder], self._Run(cmd + [url, folder],
options, git_filter=True, filter_fn=filter_fn, options, filter_fn=filter_fn, cwd=self.cache_dir, retry=True)
cwd=self.cache_dir, retry=True)
else: else:
# For now, assert that host/path/to/repo.git is identical. We may want # For now, assert that host/path/to/repo.git is identical. We may want
# to relax this restriction in the future to allow for smarter cache # to relax this restriction in the future to allow for smarter cache
...@@ -819,8 +818,7 @@ class GitWrapper(SCMWrapper): ...@@ -819,8 +818,7 @@ class GitWrapper(SCMWrapper):
# Would normally use `git remote update`, but it doesn't support # Would normally use `git remote update`, but it doesn't support
# --progress, so use fetch instead. # --progress, so use fetch instead.
self._Run(['fetch'] + v + ['--multiple', '--progress', '--all'], self._Run(['fetch'] + v + ['--multiple', '--progress', '--all'],
options, git_filter=True, filter_fn=filter_fn, cwd=folder, options, filter_fn=filter_fn, cwd=folder, retry=True)
retry=True)
# If the clone has an object dependency on the existing repo, break it # If the clone has an object dependency on the existing repo, break it
# with repack and remove the linkage. # with repack and remove the linkage.
...@@ -859,8 +857,7 @@ class GitWrapper(SCMWrapper): ...@@ -859,8 +857,7 @@ class GitWrapper(SCMWrapper):
dir=parent_dir) dir=parent_dir)
try: try:
clone_cmd.append(tmp_dir) clone_cmd.append(tmp_dir)
self._Run(clone_cmd, options, cwd=self._root_dir, git_filter=True, self._Run(clone_cmd, options, cwd=self._root_dir, retry=True)
retry=True)
gclient_utils.safe_makedirs(self.checkout_path) gclient_utils.safe_makedirs(self.checkout_path)
gclient_utils.safe_rename(os.path.join(tmp_dir, '.git'), gclient_utils.safe_rename(os.path.join(tmp_dir, '.git'),
os.path.join(self.checkout_path, '.git')) os.path.join(self.checkout_path, '.git'))
...@@ -1037,8 +1034,9 @@ class GitWrapper(SCMWrapper): ...@@ -1037,8 +1034,9 @@ class GitWrapper(SCMWrapper):
fetch_cmd.append('--verbose') fetch_cmd.append('--verbose')
self._Run(fetch_cmd, options, retry=True) self._Run(fetch_cmd, options, retry=True)
def _Run(self, args, _options, git_filter=False, **kwargs): def _Run(self, args, options, **kwargs):
kwargs.setdefault('cwd', self.checkout_path) kwargs.setdefault('cwd', self.checkout_path)
git_filter = not options.verbose
if git_filter: if git_filter:
kwargs['filter_fn'] = GitFilter(kwargs.get('filter_fn')) kwargs['filter_fn'] = GitFilter(kwargs.get('filter_fn'))
kwargs.setdefault('print_stdout', False) kwargs.setdefault('print_stdout', False)
......
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