summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2011-09-19 14:50:58 -0700
committerShawn O. Pearce <sop@google.com>2011-09-28 10:07:36 -0700
commitf322b9abb4cadc67b991baf6ba1b9f2fbd5d7812 (patch)
treece75a04fed2e84457800325d158de13645cef67e /main.py
parentdb728cd866d4950779620993e12e76f09eb6e2ee (diff)
downloadgit-repo-f322b9abb4cadc67b991baf6ba1b9f2fbd5d7812.tar.gz
sync: Support downloading bundle to initialize repositoryv1.7.7
An HTTP (or HTTPS) based remote server may now offer a 'clone.bundle' file in each repository's Git directory. Over an http:// or https:// remote repo will first ask for '$URL/clone.bundle', and if present download this to bootstrap the local client, rather than relying on the native Git transport to initialize the new repository. Bundles may be hosted elsewhere. The client automatically follows a HTTP 302 redirect to acquire the bundle file. This allows servers to direct clients to cached copies residing on content delivery networks, where the bundle may be closer to the end-user. Bundle downloads are resumeable from where they last left off, allowing clients to initialize large repositories even when the connection gets interrupted. If a bundle does not exist for a repository (a HTTP 404 response code is returned for '$URL/clone.bundle'), the native Git transport is used instead. If the client is performing a shallow sync, the bundle transport is not used, as there is no way to embed shallow data into the bundle. Change-Id: I05dad17792fd6fd20635a0f71589566e557cc743 Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.py b/main.py
index c5c71c36..8ffdfcce 100755
--- a/main.py
+++ b/main.py
@@ -37,6 +37,7 @@ from command import InteractiveCommand
37from command import MirrorSafeCommand 37from command import MirrorSafeCommand
38from command import PagedCommand 38from command import PagedCommand
39from editor import Editor 39from editor import Editor
40from error import DownloadError
40from error import ManifestInvalidRevisionError 41from error import ManifestInvalidRevisionError
41from error import NoSuchProjectError 42from error import NoSuchProjectError
42from error import RepoChangedException 43from error import RepoChangedException
@@ -143,6 +144,9 @@ class _Repo(object):
143 else: 144 else:
144 print >>sys.stderr, 'real\t%dh%dm%.3fs' \ 145 print >>sys.stderr, 'real\t%dh%dm%.3fs' \
145 % (hours, minutes, seconds) 146 % (hours, minutes, seconds)
147 except DownloadError, e:
148 print >>sys.stderr, 'error: %s' % str(e)
149 sys.exit(1)
146 except ManifestInvalidRevisionError, e: 150 except ManifestInvalidRevisionError, e:
147 print >>sys.stderr, 'error: %s' % str(e) 151 print >>sys.stderr, 'error: %s' % str(e)
148 sys.exit(1) 152 sys.exit(1)