Show More
@@ -6,9 +6,8 b'' | |||
|
6 | 6 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | 7 | |
|
8 | 8 | from node import bin, hex, nullid |
|
9 | from revlog import revlog, RevlogError | |
|
10 | 9 | from i18n import _ |
|
11 | import util, error | |
|
10 | import util, error, revlog | |
|
12 | 11 | |
|
13 | 12 | def _string_escape(text): |
|
14 | 13 | """ |
@@ -75,9 +74,9 b' class appender:' | |||
|
75 | 74 | self.data.append(str(s)) |
|
76 | 75 | self.offset += len(s) |
|
77 | 76 | |
|
78 | class changelog(revlog): | |
|
77 | class changelog(revlog.revlog): | |
|
79 | 78 | def __init__(self, opener): |
|
80 | revlog.__init__(self, opener, "00changelog.i") | |
|
79 | revlog.revlog.__init__(self, opener, "00changelog.i") | |
|
81 | 80 | |
|
82 | 81 | def delayupdate(self): |
|
83 | 82 | "delay visibility of index updates to other readers" |
@@ -119,7 +118,7 b' class changelog(revlog):' | |||
|
119 | 118 | def checkinlinesize(self, tr, fp=None): |
|
120 | 119 | if self.opener == self._delayopener: |
|
121 | 120 | return |
|
122 | return revlog.checkinlinesize(self, tr, fp) | |
|
121 | return revlog.revlog.checkinlinesize(self, tr, fp) | |
|
123 | 122 | |
|
124 | 123 | def decode_extra(self, text): |
|
125 | 124 | extra = {} |
@@ -5,12 +5,11 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms |
|
6 | 6 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | 7 | |
|
8 | from node import bin, nullid | |
|
9 | from revlog import revlog | |
|
8 | import revlog | |
|
10 | 9 | |
|
11 | class filelog(revlog): | |
|
10 | class filelog(revlog.revlog): | |
|
12 | 11 | def __init__(self, opener, path): |
|
13 | revlog.__init__(self, opener, | |
|
12 | revlog.revlog.__init__(self, opener, | |
|
14 | 13 | "/".join(("data", self.encodedir(path + ".i")))) |
|
15 | 14 | |
|
16 | 15 | # This avoids a collision between a file named foo and a dir named |
@@ -55,11 +54,11 b' class filelog(revlog):' | |||
|
55 | 54 | return self.addrevision(text, transaction, link, p1, p2) |
|
56 | 55 | |
|
57 | 56 | def renamed(self, node): |
|
58 | if self.parents(node)[0] != nullid: | |
|
57 | if self.parents(node)[0] != revlog.nullid: | |
|
59 | 58 | return False |
|
60 | 59 | m = self._readmeta(node) |
|
61 | 60 | if m and "copy" in m: |
|
62 | return (m["copy"], bin(m["copyrev"])) | |
|
61 | return (m["copy"], revlog.bin(m["copyrev"])) | |
|
63 | 62 | return False |
|
64 | 63 | |
|
65 | 64 | def size(self, rev): |
@@ -70,7 +69,7 b' class filelog(revlog):' | |||
|
70 | 69 | if self.renamed(node): |
|
71 | 70 | return len(self.read(node)) |
|
72 | 71 | |
|
73 | return revlog.size(self, rev) | |
|
72 | return revlog.revlog.size(self, rev) | |
|
74 | 73 | |
|
75 | 74 | def cmp(self, node, text): |
|
76 | 75 | """compare text with a given file revision""" |
@@ -80,4 +79,4 b' class filelog(revlog):' | |||
|
80 | 79 | t2 = self.read(node) |
|
81 | 80 | return t2 != text |
|
82 | 81 | |
|
83 | return revlog.cmp(self, node, text) | |
|
82 | return revlog.revlog.cmp(self, node, text) |
@@ -5,10 +5,8 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms |
|
6 | 6 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | 7 | |
|
8 | from node import bin, hex, nullid | |
|
9 | from revlog import revlog | |
|
10 | 8 | from i18n import _ |
|
11 | import array, struct, mdiff, parsers, util, error | |
|
9 | import array, struct, mdiff, parsers, util, error, revlog | |
|
12 | 10 | |
|
13 | 11 | class manifestdict(dict): |
|
14 | 12 | def __init__(self, mapping=None, flags=None): |
@@ -23,11 +21,11 b' class manifestdict(dict):' | |||
|
23 | 21 | def copy(self): |
|
24 | 22 | return manifestdict(dict.copy(self), dict.copy(self._flags)) |
|
25 | 23 | |
|
26 | class manifest(revlog): | |
|
24 | class manifest(revlog.revlog): | |
|
27 | 25 | def __init__(self, opener): |
|
28 | 26 | self.mapcache = None |
|
29 | 27 | self.listcache = None |
|
30 | revlog.__init__(self, opener, "00manifest.i") | |
|
28 | revlog.revlog.__init__(self, opener, "00manifest.i") | |
|
31 | 29 | |
|
32 | 30 | def parse(self, lines): |
|
33 | 31 | mfdict = manifestdict() |
@@ -39,7 +37,8 b' class manifest(revlog):' | |||
|
39 | 37 | return self.parse(mdiff.patchtext(self.revdiff(r - 1, r))) |
|
40 | 38 | |
|
41 | 39 | def read(self, node): |
|
42 | if node == nullid: return manifestdict() # don't upset local cache | |
|
40 | if node == revlog.nullid: | |
|
41 | return manifestdict() # don't upset local cache | |
|
43 | 42 | if self.mapcache and self.mapcache[0] == node: |
|
44 | 43 | return self.mapcache[1] |
|
45 | 44 | text = self.revision(node) |
@@ -101,7 +100,7 b' class manifest(revlog):' | |||
|
101 | 100 | return None, None |
|
102 | 101 | l = text[start:end] |
|
103 | 102 | f, n = l.split('\0') |
|
104 | return bin(n[:40]), n[40:-1] | |
|
103 | return revlog.bin(n[:40]), n[40:-1] | |
|
105 | 104 | |
|
106 | 105 | def add(self, map, transaction, link, p1=None, p2=None, |
|
107 | 106 | changed=None): |
@@ -136,7 +135,8 b' class manifest(revlog):' | |||
|
136 | 135 | |
|
137 | 136 | # if this is changed to support newlines in filenames, |
|
138 | 137 | # be sure to check the templates/ dir again (especially *-raw.tmpl) |
|
139 | text = ["%s\000%s%s\n" % (f, hex(map[f]), map.flags(f)) | |
|
138 | hex, flags = revlog.hex, map.flags | |
|
139 | text = ["%s\000%s%s\n" % (f, hex(map[f]), flags(f)) | |
|
140 | 140 | for f in files] |
|
141 | 141 | self.listcache = array.array('c', "".join(text)) |
|
142 | 142 | cachedelta = None |
@@ -164,7 +164,7 b' class manifest(revlog):' | |||
|
164 | 164 | # bs will either be the index of the item or the insert point |
|
165 | 165 | start, end = self._search(addbuf, f, start) |
|
166 | 166 | if w[1] == 0: |
|
167 | l = "%s\000%s%s\n" % (f, hex(map[f]), map.flags(f)) | |
|
167 | l = "%s\000%s%s\n" % (f, revlog.hex(map[f]), map.flags(f)) | |
|
168 | 168 | else: |
|
169 | 169 | l = "" |
|
170 | 170 | if start == end and w[1] == 1: |
General Comments 0
You need to be logged in to leave comments.
Login now