##// END OF EJS Templates
pure: update index parsing
Matt Mackall -
r13261:20a54bdf default
parent child Browse files
Show More
@@ -24,7 +24,7 b' def parse_manifest(mfdict, fdict, lines)'
24 else:
24 else:
25 mfdict[f] = bin(n)
25 mfdict[f] = bin(n)
26
26
27 def parse_index(data, inline):
27 def parse_index2(data, inline):
28 def gettype(q):
28 def gettype(q):
29 return int(q & 0xFFFF)
29 return int(q & 0xFFFF)
30
30
@@ -36,7 +36,6 b' def parse_index(data, inline):'
36 s = struct.calcsize(indexformatng)
36 s = struct.calcsize(indexformatng)
37 index = []
37 index = []
38 cache = None
38 cache = None
39 nodemap = {nullid: nullrev}
40 n = off = 0
39 n = off = 0
41
40
42 l = len(data) - s
41 l = len(data) - s
@@ -45,7 +44,6 b' def parse_index(data, inline):'
45 cache = (0, data)
44 cache = (0, data)
46 while off <= l:
45 while off <= l:
47 e = _unpack(indexformatng, data[off:off + s])
46 e = _unpack(indexformatng, data[off:off + s])
48 nodemap[e[7]] = n
49 append(e)
47 append(e)
50 n += 1
48 n += 1
51 if e[1] < 0:
49 if e[1] < 0:
@@ -54,7 +52,6 b' def parse_index(data, inline):'
54 else:
52 else:
55 while off <= l:
53 while off <= l:
56 e = _unpack(indexformatng, data[off:off + s])
54 e = _unpack(indexformatng, data[off:off + s])
57 nodemap[e[7]] = n
58 append(e)
55 append(e)
59 n += 1
56 n += 1
60 off += s
57 off += s
@@ -67,7 +64,7 b' def parse_index(data, inline):'
67 # add the magic null revision at -1
64 # add the magic null revision at -1
68 index.append((0, 0, 0, -1, -1, -1, -1, nullid))
65 index.append((0, 0, 0, -1, -1, -1, -1, nullid))
69
66
70 return index, nodemap, cache
67 return index, cache
71
68
72 def parse_dirstate(dmap, copymap, st):
69 def parse_dirstate(dmap, copymap, st):
73 parents = [st[:20], st[20: 40]]
70 parents = [st[:20], st[20: 40]]
General Comments 0
You need to be logged in to leave comments. Login now