comparison mercurial/exchange.py @ 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 f9a9a6d63e89
children c15b66a6bbb4
comparison
equal deleted inserted replaced
21066:5ecfe76d0d96 21067:7974aa88868e
30 raise util.Abort(_('%s: not a Mercurial bundle') % fname) 30 raise util.Abort(_('%s: not a Mercurial bundle') % fname)
31 if version == '10': 31 if version == '10':
32 if alg is None: 32 if alg is None:
33 alg = changegroup.readexactly(fh, 2) 33 alg = changegroup.readexactly(fh, 2)
34 return changegroup.unbundle10(fh, alg) 34 return changegroup.unbundle10(fh, alg)
35 elif version == '20':
36 return bundle2.unbundle20(ui, fh, header=magic + version)
35 else: 37 else:
36 raise util.Abort(_('%s: unknown bundle version %s') % (fname, version)) 38 raise util.Abort(_('%s: unknown bundle version %s') % (fname, version))
37 39
38 40
39 class pushoperation(object): 41 class pushoperation(object):