Show More
@@ -69,6 +69,16 b' def canperformstreamclone(pullop, bundle' | |||||
69 | repo = pullop.repo |
|
69 | repo = pullop.repo | |
70 | remote = pullop.remote |
|
70 | remote = pullop.remote | |
71 |
|
71 | |||
|
72 | # should we consider streaming clone at all ? | |||
|
73 | streamrequested = pullop.streamclonerequested | |||
|
74 | # If we don't have a preference, let the server decide for us. This | |||
|
75 | # likely only comes into play in LANs. | |||
|
76 | if streamrequested is None: | |||
|
77 | # The server can advertise whether to prefer streaming clone. | |||
|
78 | streamrequested = remote.capable(b'stream-preferred') | |||
|
79 | if not streamrequested: | |||
|
80 | return False, None | |||
|
81 | ||||
72 | # Streaming clone only works on an empty destination repository |
|
82 | # Streaming clone only works on an empty destination repository | |
73 | if len(repo): |
|
83 | if len(repo): | |
74 | return False, None |
|
84 | return False, None | |
@@ -92,17 +102,6 b' def canperformstreamclone(pullop, bundle' | |||||
92 | elif bundle2 and not bundle2supported: |
|
102 | elif bundle2 and not bundle2supported: | |
93 | return False, None |
|
103 | return False, None | |
94 |
|
104 | |||
95 | streamrequested = pullop.streamclonerequested |
|
|||
96 |
|
||||
97 | # If we don't have a preference, let the server decide for us. This |
|
|||
98 | # likely only comes into play in LANs. |
|
|||
99 | if streamrequested is None: |
|
|||
100 | # The server can advertise whether to prefer streaming clone. |
|
|||
101 | streamrequested = remote.capable(b'stream-preferred') |
|
|||
102 |
|
||||
103 | if not streamrequested: |
|
|||
104 | return False, None |
|
|||
105 |
|
||||
106 | # In order for stream clone to work, the client has to support all the |
|
105 | # In order for stream clone to work, the client has to support all the | |
107 | # requirements advertised by the server. |
|
106 | # requirements advertised by the server. | |
108 | # |
|
107 | # |
General Comments 0
You need to be logged in to leave comments.
Login now