diff options
-rwxr-xr-x | repo | 9 | ||||
-rw-r--r-- | subcmds/init.py | 11 |
2 files changed, 16 insertions, 4 deletions
@@ -196,6 +196,9 @@ group.add_option('-p', '--platform', | |||
196 | help='restrict manifest projects to ones with a specified ' | 196 | help='restrict manifest projects to ones with a specified ' |
197 | 'platform group [auto|all|none|linux|darwin|...]', | 197 | 'platform group [auto|all|none|linux|darwin|...]', |
198 | metavar='PLATFORM') | 198 | metavar='PLATFORM') |
199 | group.add_option('--no-clone-bundle', | ||
200 | dest='no_clone_bundle', action='store_true', | ||
201 | help='disable use of /clone.bundle on HTTP/HTTPS') | ||
199 | 202 | ||
200 | 203 | ||
201 | # Tool | 204 | # Tool |
@@ -339,7 +342,7 @@ def _Init(args, gitc_init=False): | |||
339 | can_verify = True | 342 | can_verify = True |
340 | 343 | ||
341 | dst = os.path.abspath(os.path.join(repodir, S_repo)) | 344 | dst = os.path.abspath(os.path.join(repodir, S_repo)) |
342 | _Clone(url, dst, opt.quiet) | 345 | _Clone(url, dst, opt.quiet, not opt.no_clone_bundle) |
343 | 346 | ||
344 | if can_verify and not opt.no_repo_verify: | 347 | if can_verify and not opt.no_repo_verify: |
345 | rev = _Verify(dst, branch, opt.quiet) | 348 | rev = _Verify(dst, branch, opt.quiet) |
@@ -577,7 +580,7 @@ def _ImportBundle(local): | |||
577 | os.remove(path) | 580 | os.remove(path) |
578 | 581 | ||
579 | 582 | ||
580 | def _Clone(url, local, quiet): | 583 | def _Clone(url, local, quiet, clone_bundle): |
581 | """Clones a git repository to a new subdirectory of repodir | 584 | """Clones a git repository to a new subdirectory of repodir |
582 | """ | 585 | """ |
583 | try: | 586 | try: |
@@ -607,7 +610,7 @@ def _Clone(url, local, quiet): | |||
607 | _SetConfig(local, | 610 | _SetConfig(local, |
608 | 'remote.origin.fetch', | 611 | 'remote.origin.fetch', |
609 | '+refs/heads/*:refs/remotes/origin/*') | 612 | '+refs/heads/*:refs/remotes/origin/*') |
610 | if _DownloadBundle(url, local, quiet): | 613 | if clone_bundle and _DownloadBundle(url, local, quiet): |
611 | _ImportBundle(local) | 614 | _ImportBundle(local) |
612 | _Fetch(url, local, 'origin', quiet) | 615 | _Fetch(url, local, 'origin', quiet) |
613 | 616 | ||
diff --git a/subcmds/init.py b/subcmds/init.py index 77153eda..45d69b79 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -61,6 +61,11 @@ directory use as much data as possible from the local reference | |||
61 | directory when fetching from the server. This will make the sync | 61 | directory when fetching from the server. This will make the sync |
62 | go a lot faster by reducing data traffic on the network. | 62 | go a lot faster by reducing data traffic on the network. |
63 | 63 | ||
64 | The --no-clone-bundle option disables any attempt to use | ||
65 | $URL/clone.bundle to bootstrap a new Git repository from a | ||
66 | resumeable bundle file on a content delivery network. This | ||
67 | may be necessary if there are problems with the local Python | ||
68 | HTTP client or proxy configuration, but the Git binary works. | ||
64 | 69 | ||
65 | Switching Manifest Branches | 70 | Switching Manifest Branches |
66 | --------------------------- | 71 | --------------------------- |
@@ -113,6 +118,9 @@ to update the working directory files. | |||
113 | help='restrict manifest projects to ones with a specified ' | 118 | help='restrict manifest projects to ones with a specified ' |
114 | 'platform group [auto|all|none|linux|darwin|...]', | 119 | 'platform group [auto|all|none|linux|darwin|...]', |
115 | metavar='PLATFORM') | 120 | metavar='PLATFORM') |
121 | g.add_option('--no-clone-bundle', | ||
122 | dest='no_clone_bundle', action='store_true', | ||
123 | help='disable use of /clone.bundle on HTTP/HTTPS') | ||
116 | 124 | ||
117 | # Tool | 125 | # Tool |
118 | g = p.add_option_group('repo Version options') | 126 | g = p.add_option_group('repo Version options') |
@@ -222,7 +230,8 @@ to update the working directory files. | |||
222 | 'in another location.', file=sys.stderr) | 230 | 'in another location.', file=sys.stderr) |
223 | sys.exit(1) | 231 | sys.exit(1) |
224 | 232 | ||
225 | if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet): | 233 | if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, |
234 | clone_bundle=not opt.no_clone_bundle): | ||
226 | r = m.GetRemote(m.remote.name) | 235 | r = m.GetRemote(m.remote.name) |
227 | print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr) | 236 | print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr) |
228 | 237 | ||