equal
deleted
inserted
replaced
13 from .i18n import _ |
13 from .i18n import _ |
14 from .pycompat import open |
14 from .pycompat import open |
15 from .interfaces import repository |
15 from .interfaces import repository |
16 from . import ( |
16 from . import ( |
17 bookmarks, |
17 bookmarks, |
|
18 bundle2 as bundle2mod, |
18 cacheutil, |
19 cacheutil, |
19 error, |
20 error, |
20 narrowspec, |
21 narrowspec, |
21 phases, |
22 phases, |
22 pycompat, |
23 pycompat, |
87 if pullop.heads: |
88 if pullop.heads: |
88 return False, None |
89 return False, None |
89 |
90 |
90 bundle2supported = False |
91 bundle2supported = False |
91 if pullop.canusebundle2: |
92 if pullop.canusebundle2: |
92 if b'v2' in pullop.remotebundle2caps.get(b'stream', []): |
93 local_caps = bundle2mod.getrepocaps(repo, role=b'client') |
93 bundle2supported = True |
94 local_supported = set(local_caps.get(b'stream', [])) |
|
95 remote_supported = set(pullop.remotebundle2caps.get(b'stream', [])) |
|
96 bundle2supported = bool(local_supported & remote_supported) |
94 # else |
97 # else |
95 # Server doesn't support bundle2 stream clone or doesn't support |
98 # Server doesn't support bundle2 stream clone or doesn't support |
96 # the versions we support. Fall back and possibly allow legacy. |
99 # the versions we support. Fall back and possibly allow legacy. |
97 |
100 |
98 # Ensures legacy code path uses available bundle2. |
101 # Ensures legacy code path uses available bundle2. |