Mercurial > hg-stable
diff mercurial/revlog.py @ 12336:9d234f7d8a77
bundle: move chunk parsing into unbundle class
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 19 Sep 2010 13:12:45 -0500 |
parents | e21fe9c5fb25 |
children | 8f97b50a8d10 |
line wrap: on
line diff
--- a/mercurial/revlog.py Sun Sep 19 12:51:54 2010 -0500 +++ b/mercurial/revlog.py Sun Sep 19 13:12:45 2010 -0500 @@ -1302,18 +1302,21 @@ # loop through our set of deltas chain = None while 1: - chunk = bundle.chunk() - if not chunk: + chunkdata = bundle.parsechunk() + if not chunkdata: break - node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80]) + node = chunkdata['node'] + p1 = chunkdata['p1'] + p2 = chunkdata['p2'] + cs = chunkdata['cs'] + delta = chunkdata['data'] + link = linkmapper(cs) if (node in self.nodemap and (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)): # this can happen if two branches make the same change chain = node continue - delta = buffer(chunk, 80) - del chunk for p in (p1, p2): if not p in self.nodemap: