bundle2: let readbundle return unbundle20
The `readbundle` function can now recognize a bundle2 stream and return the
appropriate unbundler. This is required for proper bundle2 support over the
wire.
--- a/mercurial/exchange.py Tue Apr 15 13:54:54 2014 -0400
+++ b/mercurial/exchange.py Tue Apr 15 13:57:15 2014 -0400
@@ -32,6 +32,8 @@
if alg is None:
alg = changegroup.readexactly(fh, 2)
return changegroup.unbundle10(fh, alg)
+ elif version == '20':
+ return bundle2.unbundle20(ui, fh, header=magic + version)
else:
raise util.Abort(_('%s: unknown bundle version %s') % (fname, version))