From bd4edc9a6996d666edfa77b6b80615ee7c8ea335 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 28 Oct 2008 16:14:05 -0700 Subject: [PATCH] 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 --- project.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/project.py b/project.py index d38af12b..46d23f62 100644 --- a/project.py +++ b/project.py @@ -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