pure: update index parsing
authorMatt Mackall <mpm@selenic.com>
Wed, 12 Jan 2011 13:54:39 -0600
changeset 13261 20a54bdf2328
parent 13260 911a4499adb0
child 13262 2f532ea537a6
pure: update index parsing
mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py	Wed Jan 12 11:34:42 2011 -0600
+++ b/mercurial/pure/parsers.py	Wed Jan 12 13:54:39 2011 -0600
@@ -24,7 +24,7 @@
         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 @@
     s = struct.calcsize(indexformatng)
     index = []
     cache = None
-    nodemap = {nullid: nullrev}
     n = off = 0
 
     l = len(data) - s
@@ -45,7 +44,6 @@
         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 @@
     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 @@
     # 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]]