Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
开源群组
repo
Commits
6a0a3648
Commit
6a0a3648
authored
8 years ago
by
David Pursehouse
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Download
Plain Diff
Merge "init: Add --no-clone-bundle option"
parents
6118faa1
9711a98d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
repo
repo
+6
-3
subcmds/init.py
subcmds/init.py
+10
-1
No files found.
repo
View file @
6a0a3648
...
...
@@ -196,6 +196,9 @@ group.add_option('-p', '--platform',
help
=
'restrict manifest projects to ones with a specified '
'platform group [auto|all|none|linux|darwin|...]'
,
metavar
=
'PLATFORM'
)
group
.
add_option
(
'--no-clone-bundle'
,
dest
=
'no_clone_bundle'
,
action
=
'store_true'
,
help
=
'disable use of /clone.bundle on HTTP/HTTPS'
)
# Tool
...
...
@@ -339,7 +342,7 @@ def _Init(args, gitc_init=False):
can_verify
=
True
dst
=
os
.
path
.
abspath
(
os
.
path
.
join
(
repodir
,
S_repo
))
_Clone
(
url
,
dst
,
opt
.
quiet
)
_Clone
(
url
,
dst
,
opt
.
quiet
,
not
opt
.
no_clone_bundle
)
if
can_verify
and
not
opt
.
no_repo_verify
:
rev
=
_Verify
(
dst
,
branch
,
opt
.
quiet
)
...
...
@@ -577,7 +580,7 @@ def _ImportBundle(local):
os
.
remove
(
path
)
def
_Clone
(
url
,
local
,
quiet
):
def
_Clone
(
url
,
local
,
quiet
,
clone_bundle
):
"""Clones a git repository to a new subdirectory of repodir
"""
try
:
...
...
@@ -607,7 +610,7 @@ def _Clone(url, local, quiet):
_SetConfig
(
local
,
'remote.origin.fetch'
,
'+refs/heads/*:refs/remotes/origin/*'
)
if
_DownloadBundle
(
url
,
local
,
quiet
):
if
clone_bundle
and
_DownloadBundle
(
url
,
local
,
quiet
):
_ImportBundle
(
local
)
_Fetch
(
url
,
local
,
'origin'
,
quiet
)
...
...
This diff is collapsed.
Click to expand it.
subcmds/init.py
View file @
6a0a3648
...
...
@@ -61,6 +61,11 @@ directory use as much data as possible from the local reference
directory when fetching from the server. This will make the sync
go a lot faster by reducing data traffic on the network.
The --no-clone-bundle option disables any attempt to use
$URL/clone.bundle to bootstrap a new Git repository from a
resumeable bundle file on a content delivery network. This
may be necessary if there are problems with the local Python
HTTP client or proxy configuration, but the Git binary works.
Switching Manifest Branches
---------------------------
...
...
@@ -113,6 +118,9 @@ to update the working directory files.
help
=
'restrict manifest projects to ones with a specified '
'platform group [auto|all|none|linux|darwin|...]'
,
metavar
=
'PLATFORM'
)
g
.
add_option
(
'--no-clone-bundle'
,
dest
=
'no_clone_bundle'
,
action
=
'store_true'
,
help
=
'disable use of /clone.bundle on HTTP/HTTPS'
)
# Tool
g
=
p
.
add_option_group
(
'repo Version options'
)
...
...
@@ -222,7 +230,8 @@ to update the working directory files.
'in another location.'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
if
not
m
.
Sync_NetworkHalf
(
is_new
=
is_new
,
quiet
=
opt
.
quiet
):
if
not
m
.
Sync_NetworkHalf
(
is_new
=
is_new
,
quiet
=
opt
.
quiet
,
clone_bundle
=
not
opt
.
no_clone_bundle
):
r
=
m
.
GetRemote
(
m
.
remote
.
name
)
print
(
'fatal: cannot obtain manifest %s'
%
r
.
url
,
file
=
sys
.
stderr
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment