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:
Shawn O. Pearce 2008-10-28 16:14:05 -07:00
parent ce03a401c6
commit bd4edc9a69

View File

@ -466,8 +466,6 @@ class Project(object):
for r in self.extraRemotes.values():
if not self._RemoteFetch(r.name):
return False
if not self._SnapshotDownload():
return False
if not self._RemoteFetch():
return False
self._RepairAndroidImportErrors()
@ -629,33 +627,6 @@ class Project(object):
self._CopyFiles()
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):
# dest should already be an absolute path, but src is project relative
# make src an absolute path