##// END OF EJS Templates
pure/parsers: fix circular imports, import mercurial modules properly
Matt Mackall -
r7945:94d7e14c default
parent child Browse files
Show More
@@ -5,8 +5,9 b''
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 from node import bin, nullid, nullrev
8 from mercurial.node import bin, nullid, nullrev
9 import revlog, dirstate, struct, util, zlib
9 from mercurial import util
10 import struct, zlib
10
11
11 _pack = struct.pack
12 _pack = struct.pack
12 _unpack = struct.unpack
13 _unpack = struct.unpack
@@ -24,7 +25,14 b' def parse_manifest(mfdict, fdict, lines)'
24 mfdict[f] = bin(n)
25 mfdict[f] = bin(n)
25
26
26 def parse_index(data, inline):
27 def parse_index(data, inline):
27 indexformatng = revlog.indexformatng
28 def gettype(q):
29 return int(q & 0xFFFF)
30
31 def offset_type(offset, type):
32 return long(long(offset) << 16 | type)
33
34 indexformatng = ">Qiiiiii20s12x"
35
28 s = struct.calcsize(indexformatng)
36 s = struct.calcsize(indexformatng)
29 index = []
37 index = []
30 cache = None
38 cache = None
@@ -52,8 +60,8 b' def parse_index(data, inline):'
52 off += s
60 off += s
53
61
54 e = list(index[0])
62 e = list(index[0])
55 type = revlog.gettype(e[0])
63 type = gettype(e[0])
56 e[0] = revlog.offset_type(0, type)
64 e[0] = offset_type(0, type)
57 index[0] = tuple(e)
65 index[0] = tuple(e)
58
66
59 # add the magic null revision at -1
67 # add the magic null revision at -1
@@ -64,7 +72,8 b' def parse_index(data, inline):'
64 def parse_dirstate(dmap, copymap, st):
72 def parse_dirstate(dmap, copymap, st):
65 parents = [st[:20], st[20: 40]]
73 parents = [st[:20], st[20: 40]]
66 # deref fields so they will be local in loop
74 # deref fields so they will be local in loop
67 e_size = struct.calcsize(dirstate._format)
75 format = ">cllll"
76 e_size = struct.calcsize(format)
68 pos1 = 40
77 pos1 = 40
69 l = len(st)
78 l = len(st)
70
79
General Comments 0
You need to be logged in to leave comments. Login now