summaryrefslogtreecommitdiffstats
path: root/subcmds/init.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 /subcmds/init.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 'subcmds/init.py')
-rw-r--r--subcmds/init.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index c35cc82c..9214aed5 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -21,6 +21,7 @@ from color import Coloring
21from command import InteractiveCommand, MirrorSafeCommand 21from command import InteractiveCommand, MirrorSafeCommand
22from error import ManifestParseError 22from error import ManifestParseError
23from project import SyncBuffer 23from project import SyncBuffer
24from git_config import GitConfig
24from git_command import git_require, MIN_GIT_VERSION 25from git_command import git_require, MIN_GIT_VERSION
25 26
26class Init(InteractiveCommand, MirrorSafeCommand): 27class Init(InteractiveCommand, MirrorSafeCommand):
@@ -108,8 +109,8 @@ to update the working directory files.
108 sys.exit(1) 109 sys.exit(1)
109 110
110 if not opt.quiet: 111 if not opt.quiet:
111 print >>sys.stderr, 'Getting manifest ...' 112 print >>sys.stderr, 'Get %s' \
112 print >>sys.stderr, ' from %s' % opt.manifest_url 113 % GitConfig.ForUser().UrlInsteadOf(opt.manifest_url)
113 m._InitGitDir() 114 m._InitGitDir()
114 115
115 if opt.manifest_branch: 116 if opt.manifest_branch:
@@ -138,7 +139,7 @@ to update the working directory files.
138 print >>sys.stderr, 'fatal: --mirror not supported on existing client' 139 print >>sys.stderr, 'fatal: --mirror not supported on existing client'
139 sys.exit(1) 140 sys.exit(1)
140 141
141 if not m.Sync_NetworkHalf(): 142 if not m.Sync_NetworkHalf(is_new=is_new):
142 r = m.GetRemote(m.remote.name) 143 r = m.GetRemote(m.remote.name)
143 print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url 144 print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url
144 145