summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2008-10-28 16:14:05 -0700
committerShawn O. Pearce <sop@google.com>2008-10-28 16:14:05 -0700
commitbd4edc9a6996d666edfa77b6b80615ee7c8ea335 (patch)
treefa78fbf11c1b9a44710dafeda73a740e8be7f583
parentce03a401c6fb5a890a3fbf03ab51f70a80370ec1 (diff)
downloadgit-repo-bd4edc9a6996d666edfa77b6b80615ee7c8ea335.tar.gz
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>
-rw-r--r--project.py29
1 files changed, 0 insertions, 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):
466 for r in self.extraRemotes.values(): 466 for r in self.extraRemotes.values():
467 if not self._RemoteFetch(r.name): 467 if not self._RemoteFetch(r.name):
468 return False 468 return False
469 if not self._SnapshotDownload():
470 return False
471 if not self._RemoteFetch(): 469 if not self._RemoteFetch():
472 return False 470 return False
473 self._RepairAndroidImportErrors() 471 self._RepairAndroidImportErrors()
@@ -629,33 +627,6 @@ class Project(object):
629 self._CopyFiles() 627 self._CopyFiles()
630 return True 628 return True
631 629
632 def _SnapshotDownload(self):
633 if self.snapshots:
634 have = set(self._allrefs.keys())
635 need = []
636
637 for tag, sn in self.snapshots.iteritems():
638 if tag not in have:
639 need.append(sn)
640
641 if need:
642 print >>sys.stderr, """
643 *** Downloading source(s) from a mirror site. ***
644 *** If the network hangs, kill and restart repo. ***
645"""
646 for sn in need:
647 try:
648 sn.Import()
649 except ImportError, e:
650 print >>sys.stderr, \
651 'error: Cannot import %s: %s' \
652 % (self.name, e)
653 return False
654 cmd = ['repack', '-a', '-d', '-f', '-l']
655 if GitCommand(self, cmd, bare = True).Wait() != 0:
656 return False
657 return True
658
659 def AddCopyFile(self, src, dest): 630 def AddCopyFile(self, src, dest):
660 # dest should already be an absolute path, but src is project relative 631 # dest should already be an absolute path, but src is project relative
661 # make src an absolute path 632 # make src an absolute path