Mercurial > public > mercurial-scm > hg-stable
diff mercurial/changegroup.py @ 14144:3c3c53d8343a
unbundler: separate delta and header parsing
Add header parsing for changelog and manifest (currently no headers might
change for next-gen bundle).
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sat, 30 Apr 2011 19:01:24 +0200 |
parents | da635d3c5620 |
children | 1ffeeb91c55d |
line wrap: on
line diff
--- a/mercurial/changegroup.py Sat Apr 30 11:03:28 2011 +0200 +++ b/mercurial/changegroup.py Sat Apr 30 19:01:24 2011 +0200 @@ -159,10 +159,21 @@ self.callback() return l - 4 - def chunk(self): - """return the next chunk from changegroup 'source' as a string""" + def changelogheader(self): + """v10 does not have a changelog header chunk""" + return {} + + def manifestheader(self): + """v10 does not have a manifest header chunk""" + return {} + + def filelogheader(self): + """return the header of the filelogs chunk, v10 only has the filename""" l = self.chunklength() - return readexactly(self._stream, l) + if not l: + return {} + fname = readexactly(self._stream, l) + return dict(filename=fname) def _deltaheader(self, headertuple, prevnode): node, p1, p2, cs = headertuple @@ -172,7 +183,7 @@ deltabase = prevnode return node, p1, p2, deltabase, cs - def parsechunk(self, prevnode): + def deltachunk(self, prevnode): l = self.chunklength() if not l: return {}