changeset 21067:7974aa88868e

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 15 Apr 2014 13:57:15 -0400
parents 5ecfe76d0d96
children c15b66a6bbb4
files mercurial/exchange.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))