mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Stop downloading snapshots as native git:// is faster
Downloading and streaming a tar into Git is slower than just letting the native git:// protocol handle the data transfer, especially when there are multiple revisions available and Git can perform delta compression across revisions. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
ce03a401c6
commit
bd4edc9a69
29
project.py
29
project.py
@ -466,8 +466,6 @@ class Project(object):
|
|||||||
for r in self.extraRemotes.values():
|
for r in self.extraRemotes.values():
|
||||||
if not self._RemoteFetch(r.name):
|
if not self._RemoteFetch(r.name):
|
||||||
return False
|
return False
|
||||||
if not self._SnapshotDownload():
|
|
||||||
return False
|
|
||||||
if not self._RemoteFetch():
|
if not self._RemoteFetch():
|
||||||
return False
|
return False
|
||||||
self._RepairAndroidImportErrors()
|
self._RepairAndroidImportErrors()
|
||||||
@ -629,33 +627,6 @@ class Project(object):
|
|||||||
self._CopyFiles()
|
self._CopyFiles()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _SnapshotDownload(self):
|
|
||||||
if self.snapshots:
|
|
||||||
have = set(self._allrefs.keys())
|
|
||||||
need = []
|
|
||||||
|
|
||||||
for tag, sn in self.snapshots.iteritems():
|
|
||||||
if tag not in have:
|
|
||||||
need.append(sn)
|
|
||||||
|
|
||||||
if need:
|
|
||||||
print >>sys.stderr, """
|
|
||||||
*** Downloading source(s) from a mirror site. ***
|
|
||||||
*** If the network hangs, kill and restart repo. ***
|
|
||||||
"""
|
|
||||||
for sn in need:
|
|
||||||
try:
|
|
||||||
sn.Import()
|
|
||||||
except ImportError, e:
|
|
||||||
print >>sys.stderr, \
|
|
||||||
'error: Cannot import %s: %s' \
|
|
||||||
% (self.name, e)
|
|
||||||
return False
|
|
||||||
cmd = ['repack', '-a', '-d', '-f', '-l']
|
|
||||||
if GitCommand(self, cmd, bare = True).Wait() != 0:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def AddCopyFile(self, src, dest):
|
def AddCopyFile(self, src, dest):
|
||||||
# dest should already be an absolute path, but src is project relative
|
# dest should already be an absolute path, but src is project relative
|
||||||
# make src an absolute path
|
# make src an absolute path
|
||||||
|
Loading…
Reference in New Issue
Block a user