Show More
@@ -39,7 +39,7 b' class revlog:' | |||
|
39 | 39 | i = self.opener(self.indexfile).read() |
|
40 | 40 | s = struct.calcsize(indexformat) |
|
41 | 41 | for f in range(0, len(i), s): |
|
42 |
# offset, size, base, linkrev, p1, p2, nodeid |
|
|
42 | # offset, size, base, linkrev, p1, p2, nodeid | |
|
43 | 43 | e = struct.unpack(indexformat, i[f:f + s]) |
|
44 | 44 | self.nodemap[e[6]] = n |
|
45 | 45 | self.index.append(e) |
@@ -48,7 +48,7 b' class revlog:' | |||
|
48 | 48 | |
|
49 | 49 | def tip(self): return self.node(len(self.index) - 1) |
|
50 | 50 | def count(self): return len(self.index) |
|
51 | def node(self, rev): return rev < 0 and nullid or self.index[rev][6] | |
|
51 | def node(self, rev): return (rev < 0) and nullid or self.index[rev][6] | |
|
52 | 52 | def rev(self, node): return self.nodemap[node] |
|
53 | 53 | def linkrev(self, node): return self.index[self.nodemap[node]][3] |
|
54 | 54 | def parents(self, node): |
@@ -103,8 +103,8 b' class revlog:' | |||
|
103 | 103 | last = last + s |
|
104 | 104 | |
|
105 | 105 | (p1, p2) = self.parents(node) |
|
106 |
if |
|
|
107 |
raise " |
|
|
106 | if node != hash(text, p1, p2): | |
|
107 | raise "integrity check failed on %s:%d" % (self.datafile, rev) | |
|
108 | 108 | |
|
109 | 109 | self.cache = (node, rev, text) |
|
110 | 110 | return text |
@@ -123,14 +123,6 b' class revlog:' | |||
|
123 | 123 | start = self.start(self.base(t)) |
|
124 | 124 | end = self.end(t) |
|
125 | 125 | prev = self.revision(self.tip()) |
|
126 | if 0: | |
|
127 | dd = self.diff(prev, text) | |
|
128 | tt = self.patch(prev, dd) | |
|
129 | if tt != text: | |
|
130 | print prev | |
|
131 | print text | |
|
132 | print tt | |
|
133 | raise "diff+patch failed" | |
|
134 | 126 | data = compress(self.diff(prev, text)) |
|
135 | 127 | |
|
136 | 128 | # full versions are inserted when the needed deltas |
@@ -151,9 +143,9 b' class revlog:' | |||
|
151 | 143 | self.nodemap[node] = n |
|
152 | 144 | entry = struct.pack(indexformat, *e) |
|
153 | 145 | |
|
154 |
transaction.add(self.datafile, e[0] |
|
|
146 | transaction.add(self.datafile, e[0]) | |
|
155 | 147 | self.opener(self.datafile, "a").write(data) |
|
156 |
transaction.add(self.indexfile, (n + 1) * len(entry) |
|
|
148 | transaction.add(self.indexfile, (n + 1) * len(entry)) | |
|
157 | 149 | self.opener(self.indexfile, "a").write(entry) |
|
158 | 150 | |
|
159 | 151 | self.cache = (node, n, text) |
General Comments 0
You need to be logged in to leave comments.
Login now