Show More
@@ -121,6 +121,7 b' from mercurial import (' | |||||
121 | revset, |
|
121 | revset, | |
122 | scmutil, |
|
122 | scmutil, | |
123 | smartset, |
|
123 | smartset, | |
|
124 | streamclone, | |||
124 | templatekw, |
|
125 | templatekw, | |
125 | util, |
|
126 | util, | |
126 | ) |
|
127 | ) | |
@@ -142,13 +143,6 b' from . import (' | |||||
142 | # ensures debug commands are registered |
|
143 | # ensures debug commands are registered | |
143 | hgdebugcommands.command |
|
144 | hgdebugcommands.command | |
144 |
|
145 | |||
145 | try: |
|
|||
146 | from mercurial import streamclone |
|
|||
147 | streamclone._walkstreamfiles |
|
|||
148 | hasstreamclone = True |
|
|||
149 | except Exception: |
|
|||
150 | hasstreamclone = False |
|
|||
151 |
|
||||
152 | cmdtable = {} |
|
146 | cmdtable = {} | |
153 | command = registrar.command(cmdtable) |
|
147 | command = registrar.command(cmdtable) | |
154 |
|
148 | |||
@@ -305,36 +299,28 b' def cloneshallow(orig, ui, repo, *args, ' | |||||
305 | else: |
|
299 | else: | |
306 | return orig() |
|
300 | return orig() | |
307 | extensions.wrapfunction(remote, 'stream_out', stream_out_shallow) |
|
301 | extensions.wrapfunction(remote, 'stream_out', stream_out_shallow) | |
308 |
|
|
302 | def stream_wrap(orig, op): | |
309 |
|
|
303 | setup_streamout(op.repo, op.remote) | |
310 | setup_streamout(op.repo, op.remote) |
|
304 | return orig(op) | |
311 | return orig(op) |
|
305 | extensions.wrapfunction( | |
312 | extensions.wrapfunction( |
|
306 | streamclone, 'maybeperformlegacystreamclone', stream_wrap) | |
313 | streamclone, 'maybeperformlegacystreamclone', stream_wrap) |
|
|||
314 |
|
307 | |||
315 |
|
|
308 | def canperformstreamclone(orig, pullop, bundle2=False): | |
316 |
|
|
309 | # remotefilelog is currently incompatible with the | |
317 |
|
|
310 | # bundle2 flavor of streamclones, so force us to use | |
318 |
|
|
311 | # v1 instead. | |
319 |
|
|
312 | if 'v2' in pullop.remotebundle2caps.get('stream', []): | |
320 |
|
|
313 | pullop.remotebundle2caps['stream'] = [ | |
321 |
|
|
314 | c for c in pullop.remotebundle2caps['stream'] | |
322 |
|
|
315 | if c != 'v2'] | |
323 |
|
|
316 | if bundle2: | |
324 |
|
|
317 | return False, None | |
325 |
|
|
318 | supported, requirements = orig(pullop, bundle2=bundle2) | |
326 |
|
|
319 | if requirements is not None: | |
327 | requirements.add(constants.SHALLOWREPO_REQUIREMENT) |
|
|||
328 | return supported, requirements |
|
|||
329 | extensions.wrapfunction( |
|
|||
330 | streamclone, 'canperformstreamclone', canperformstreamclone) |
|
|||
331 | else: |
|
|||
332 | def stream_in_shallow(orig, repo, remote, requirements): |
|
|||
333 | setup_streamout(repo, remote) |
|
|||
334 | requirements.add(constants.SHALLOWREPO_REQUIREMENT) |
|
320 | requirements.add(constants.SHALLOWREPO_REQUIREMENT) | |
335 |
|
|
321 | return supported, requirements | |
336 |
|
|
322 | extensions.wrapfunction( | |
337 | localrepo.localrepository, 'stream_in', stream_in_shallow) |
|
323 | streamclone, 'canperformstreamclone', canperformstreamclone) | |
338 |
|
324 | |||
339 | try: |
|
325 | try: | |
340 | orig(ui, repo, *args, **opts) |
|
326 | orig(ui, repo, *args, **opts) |
General Comments 0
You need to be logged in to leave comments.
Login now