diff 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
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue Mar 29 18:15:49 2022 +0900
+++ b/mercurial/bundle2.py	Thu Mar 24 12:27:21 2022 -0400
@@ -2528,7 +2528,8 @@
 @parthandler(b'stream2', (b'requirements', b'filecount', b'bytecount'))
 def handlestreamv2bundle(op, part):
 
-    requirements = urlreq.unquote(part.params[b'requirements']).split(b',')
+    requirements = urlreq.unquote(part.params[b'requirements'])
+    requirements = requirements.split(b',') if requirements else []
     filecount = int(part.params[b'filecount'])
     bytecount = int(part.params[b'bytecount'])