# HG changeset patch # User Matt Mackall # Date 2011-01-12 19:54:39 # Node ID 20a54bdf232832d3d6c4e4a43361dc84ec73dca0 # Parent 911a4499adb0f6ffae86b6c70d8ce6672ddccda9 pure: update index parsing diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py +++ b/mercurial/pure/parsers.py @@ -24,7 +24,7 @@ def parse_manifest(mfdict, fdict, lines) else: mfdict[f] = bin(n) -def parse_index(data, inline): +def parse_index2(data, inline): def gettype(q): return int(q & 0xFFFF) @@ -36,7 +36,6 @@ def parse_index(data, inline): s = struct.calcsize(indexformatng) index = [] cache = None - nodemap = {nullid: nullrev} n = off = 0 l = len(data) - s @@ -45,7 +44,6 @@ def parse_index(data, inline): cache = (0, data) while off <= l: e = _unpack(indexformatng, data[off:off + s]) - nodemap[e[7]] = n append(e) n += 1 if e[1] < 0: @@ -54,7 +52,6 @@ def parse_index(data, inline): else: while off <= l: e = _unpack(indexformatng, data[off:off + s]) - nodemap[e[7]] = n append(e) n += 1 off += s @@ -67,7 +64,7 @@ def parse_index(data, inline): # add the magic null revision at -1 index.append((0, 0, 0, -1, -1, -1, -1, nullid)) - return index, nodemap, cache + return index, cache def parse_dirstate(dmap, copymap, st): parents = [st[:20], st[20: 40]]