bundle2: let readbundle return unbundle20
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 15 Apr 2014 13:57:15 -0400
changeset 21067 7974aa88868e
parent 21066 5ecfe76d0d96
child 21068 c15b66a6bbb4
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.
mercurial/exchange.py
--- 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))