Update depot_tools.diff
This commit is contained in:
parent
fd177a7772
commit
abf39d8c09
@ -1,8 +1,9 @@
|
|||||||
diff --git a/gclient_scm.py b/gclient_scm.py
|
diff --git a/gclient_scm.py b/gclient_scm.py
|
||||||
|
index f58c07a8..c8409726 100644
|
||||||
--- a/gclient_scm.py
|
--- a/gclient_scm.py
|
||||||
+++ b/gclient_scm.py
|
+++ b/gclient_scm.py
|
||||||
@@ -1012,28 +1012,35 @@ class GitWrapper(SCMWrapper):
|
@@ -1137,31 +1137,29 @@ class GitWrapper(SCMWrapper):
|
||||||
gclient_utils.safe_makedirs(parent_dir)
|
clone_cmd.append(url)
|
||||||
|
|
||||||
template_dir = None
|
template_dir = None
|
||||||
+ use_fetch = False
|
+ use_fetch = False
|
||||||
@ -13,15 +14,19 @@ diff --git a/gclient_scm.py b/gclient_scm.py
|
|||||||
+
|
+
|
||||||
if hasattr(options, 'no_history') and options.no_history:
|
if hasattr(options, 'no_history') and options.no_history:
|
||||||
if gclient_utils.IsGitSha(revision):
|
if gclient_utils.IsGitSha(revision):
|
||||||
# In the case of a subproject, the pinned sha is not necessarily the
|
- # In the case of a subproject, the pinned sha is not necessarily the
|
||||||
# head of the remote branch (so we can't just use --depth=N). Instead,
|
- # head of the remote branch (so we can't just use --depth=N). Instead,
|
||||||
# we tell git to fetch all the remote objects from SHA..HEAD by means of
|
- # we tell git to fetch all the remote objects from SHA..HEAD by means
|
||||||
# a template git dir which has a 'shallow' file pointing to the sha.
|
- # of a template git dir which has a 'shallow' file pointing to the
|
||||||
- template_dir = tempfile.mkdtemp(
|
- # sha.
|
||||||
- prefix='_gclient_gittmp_%s' % os.path.basename(self.checkout_path),
|
- template_dir = tempfile.mkdtemp(prefix='_gclient_gittmp_%s' %
|
||||||
|
- os.path.basename(self.checkout_path),
|
||||||
- dir=parent_dir)
|
- dir=parent_dir)
|
||||||
- self._Run(['init', '--bare', template_dir], options, cwd=self._root_dir)
|
- self._Run(['init', '--bare', template_dir],
|
||||||
- with open(os.path.join(template_dir, 'shallow'), 'w') as template_file:
|
- options,
|
||||||
|
- cwd=self._root_dir)
|
||||||
|
- with open(os.path.join(template_dir, 'shallow'),
|
||||||
|
- 'w') as template_file:
|
||||||
- template_file.write(revision)
|
- template_file.write(revision)
|
||||||
- clone_cmd.append('--template=' + template_dir)
|
- clone_cmd.append('--template=' + template_dir)
|
||||||
+ self._Run(['init', tmp_dir], options, cwd=self._root_dir)
|
+ self._Run(['init', tmp_dir], options, cwd=self._root_dir)
|
||||||
@ -37,18 +42,16 @@ diff --git a/gclient_scm.py b/gclient_scm.py
|
|||||||
# Otherwise, we're just interested in the HEAD. Just use --depth.
|
# Otherwise, we're just interested in the HEAD. Just use --depth.
|
||||||
clone_cmd.append('--depth=1')
|
clone_cmd.append('--depth=1')
|
||||||
|
|
||||||
- tmp_dir = tempfile.mkdtemp(
|
- tmp_dir = tempfile.mkdtemp(prefix='_gclient_%s_' %
|
||||||
- prefix='_gclient_%s_' % os.path.basename(self.checkout_path),
|
- os.path.basename(self.checkout_path),
|
||||||
- dir=parent_dir)
|
- dir=parent_dir)
|
||||||
try:
|
|
||||||
- clone_cmd.append(tmp_dir)
|
- clone_cmd.append(tmp_dir)
|
||||||
+ if use_fetch == False:
|
+ if use_fetch == False:
|
||||||
+ clone_cmd.append(tmp_dir)
|
+ clone_cmd.append(tmp_dir)
|
||||||
+
|
|
||||||
if self.print_outbuf:
|
try:
|
||||||
print_stdout = True
|
self._Run(clone_cmd,
|
||||||
filter_fn = None
|
@@ -1452,6 +1450,9 @@ class GitWrapper(SCMWrapper):
|
||||||
@@ -1328,6 +1335,9 @@ class GitWrapper(SCMWrapper):
|
|
||||||
if refspec:
|
if refspec:
|
||||||
fetch_cmd.append(refspec)
|
fetch_cmd.append(refspec)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user