Show More
@@ -17,7 +17,7 b' from . import (' | |||||
17 | util, |
|
17 | util, | |
18 | ) |
|
18 | ) | |
19 |
|
19 | |||
20 | def canperformstreamclone(repo, remote, heads, streamrequested=None): |
|
20 | def canperformstreamclone(pullop): | |
21 | """Whether it is possible to perform a streaming clone as part of pull. |
|
21 | """Whether it is possible to perform a streaming clone as part of pull. | |
22 |
|
22 | |||
23 | Returns a tuple of (supported, requirements). ``supported`` is True if |
|
23 | Returns a tuple of (supported, requirements). ``supported`` is True if | |
@@ -25,14 +25,19 b' def canperformstreamclone(repo, remote, ' | |||||
25 | a set of repo requirements from the remote, or ``None`` if stream clone |
|
25 | a set of repo requirements from the remote, or ``None`` if stream clone | |
26 | isn't supported. |
|
26 | isn't supported. | |
27 | """ |
|
27 | """ | |
|
28 | repo = pullop.repo | |||
|
29 | remote = pullop.remote | |||
|
30 | ||||
28 | # Streaming clone only works on empty repositories. |
|
31 | # Streaming clone only works on empty repositories. | |
29 | if len(repo): |
|
32 | if len(repo): | |
30 | return False, None |
|
33 | return False, None | |
31 |
|
34 | |||
32 | # Streaming clone only works if all data is being requested. |
|
35 | # Streaming clone only works if all data is being requested. | |
33 | if heads: |
|
36 | if pullop.heads: | |
34 | return False, None |
|
37 | return False, None | |
35 |
|
38 | |||
|
39 | streamrequested = pullop.streamclonerequested | |||
|
40 | ||||
36 | # If we don't have a preference, let the server decide for us. This |
|
41 | # If we don't have a preference, let the server decide for us. This | |
37 | # likely only comes into play in LANs. |
|
42 | # likely only comes into play in LANs. | |
38 | if streamrequested is None: |
|
43 | if streamrequested is None: | |
@@ -75,16 +80,14 b' def maybeperformlegacystreamclone(pullop' | |||||
75 | A legacy stream clone will not be performed if a bundle2 stream clone is |
|
80 | A legacy stream clone will not be performed if a bundle2 stream clone is | |
76 | supported. |
|
81 | supported. | |
77 | """ |
|
82 | """ | |
78 | repo = pullop.repo |
|
83 | supported, requirements = canperformstreamclone(pullop) | |
79 | remote = pullop.remote |
|
|||
80 |
|
||||
81 | r = canperformstreamclone(repo, remote, pullop.heads, |
|
|||
82 | streamrequested=pullop.streamclonerequested) |
|
|||
83 | supported, requirements = r |
|
|||
84 |
|
84 | |||
85 | if not supported: |
|
85 | if not supported: | |
86 | return |
|
86 | return | |
87 |
|
87 | |||
|
88 | repo = pullop.repo | |||
|
89 | remote = pullop.remote | |||
|
90 | ||||
88 | # Save remote branchmap. We will use it later to speed up branchcache |
|
91 | # Save remote branchmap. We will use it later to speed up branchcache | |
89 | # creation. |
|
92 | # creation. | |
90 | rbranchmap = None |
|
93 | rbranchmap = None |
General Comments 0
You need to be logged in to leave comments.
Login now