comparison mercurial/bundle2.py @ 48990:d9ed7c5e915d stable

streamclone: avoid some obscure error in a corner case I don't really know how, but I ran into this error: $ hg clone --stream ssh://user@dummy/empty-repo local-empty-repo streaming all changes abort: unable to apply stream clone: unsupported format: [255] I think you need an empty list of requirements for this to happen, which is weird, but an obscure error like this is not exactly helpful either. Since this is the result of an encoding bug anyway, just fix it. Differential Revision: https://phab.mercurial-scm.org/D12402
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Thu, 24 Mar 2022 12:27:21 -0400
parents a3cf460a6b1b
children bde2e4ef968a
comparison
equal deleted inserted replaced
48989:d4b66dc500c5 48990:d9ed7c5e915d
2526 2526
2527 2527
2528 @parthandler(b'stream2', (b'requirements', b'filecount', b'bytecount')) 2528 @parthandler(b'stream2', (b'requirements', b'filecount', b'bytecount'))
2529 def handlestreamv2bundle(op, part): 2529 def handlestreamv2bundle(op, part):
2530 2530
2531 requirements = urlreq.unquote(part.params[b'requirements']).split(b',') 2531 requirements = urlreq.unquote(part.params[b'requirements'])
2532 requirements = requirements.split(b',') if requirements else []
2532 filecount = int(part.params[b'filecount']) 2533 filecount = int(part.params[b'filecount'])
2533 bytecount = int(part.params[b'bytecount']) 2534 bytecount = int(part.params[b'bytecount'])
2534 2535
2535 repo = op.repo 2536 repo = op.repo
2536 if len(repo): 2537 if len(repo):