##// END OF EJS Templates
revlog: remove support for punched/shallow...
Sune Foldager -
r14196:e7483ec3 default
parent child Browse files
Show More
@@ -34,8 +34,7 b' REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_'
34 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
34 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
35
35
36 # revlog index flags
36 # revlog index flags
37 REVIDX_PUNCHED_FLAG = 2
37 REVIDX_KNOWN_FLAGS = 0
38 REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG
39
38
40 # max size of revlog with inline data
39 # max size of revlog with inline data
41 _maxinline = 131072
40 _maxinline = 131072
@@ -891,8 +890,7 b' class revlog(object):'
891
890
892 def _checkhash(self, text, node, rev):
891 def _checkhash(self, text, node, rev):
893 p1, p2 = self.parents(node)
892 p1, p2 = self.parents(node)
894 if (node != hash(text, p1, p2) and
893 if node != hash(text, p1, p2):
895 not (self.flags(rev) & REVIDX_PUNCHED_FLAG)):
896 raise RevlogError(_("integrity check failed on %s:%d")
894 raise RevlogError(_("integrity check failed on %s:%d")
897 % (self.indexfile, rev))
895 % (self.indexfile, rev))
898 return text
896 return text
@@ -946,8 +944,7 b' class revlog(object):'
946 cachedelta - an optional precomputed delta
944 cachedelta - an optional precomputed delta
947 """
945 """
948 node = hash(text, p1, p2)
946 node = hash(text, p1, p2)
949 if (node in self.nodemap and
947 if node in self.nodemap:
950 (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
951 return node
948 return node
952
949
953 dfh = None
950 dfh = None
@@ -1009,14 +1006,12 b' class revlog(object):'
1009
1006
1010 # full versions are inserted when the needed deltas
1007 # full versions are inserted when the needed deltas
1011 # become comparable to the uncompressed text
1008 # become comparable to the uncompressed text
1012 # or the base revision is punched
1013 if text is None:
1009 if text is None:
1014 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
1010 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
1015 cachedelta[1])
1011 cachedelta[1])
1016 else:
1012 else:
1017 textlen = len(text)
1013 textlen = len(text)
1018 if (d is None or dist > textlen * 2 or
1014 if d is None or dist > textlen * 2:
1019 (self.flags(base) & REVIDX_PUNCHED_FLAG)):
1020 text = buildtext()
1015 text = buildtext()
1021 data = compress(text)
1016 data = compress(text)
1022 l = len(data[1]) + len(data[0])
1017 l = len(data[1]) + len(data[0])
@@ -1120,32 +1115,15 b' class revlog(object):'
1120 delta = chunkdata['delta']
1115 delta = chunkdata['delta']
1121
1116
1122 link = linkmapper(cs)
1117 link = linkmapper(cs)
1123 if (node in self.nodemap and
1118 if node in self.nodemap:
1124 (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
1125 # this can happen if two branches make the same change
1119 # this can happen if two branches make the same change
1126 chain = node
1120 chain = node
1127 continue
1121 continue
1128
1122
1129 for p in (p1, p2):
1123 for p in (p1, p2):
1130 if not p in self.nodemap:
1124 if not p in self.nodemap:
1131 if self._shallow:
1125 raise LookupError(p, self.indexfile,
1132 # add null entries for missing parents
1126 _('unknown parent'))
1133 # XXX FIXME
1134 #if base == nullrev:
1135 # base = len(self)
1136 #e = (offset_type(end, REVIDX_PUNCHED_FLAG),
1137 # 0, 0, base, nullrev, nullrev, nullrev, p)
1138 #self.index.insert(-1, e)
1139 #self.nodemap[p] = r
1140 #entry = self._io.packentry(e, self.node,
1141 # self.version, r)
1142 #ifh.write(entry)
1143 #t, r = r, r + 1
1144 raise LookupError(p, self.indexfile,
1145 _('unknown parent'))
1146 else:
1147 raise LookupError(p, self.indexfile,
1148 _('unknown parent'))
1149
1127
1150 if deltabase not in self.nodemap:
1128 if deltabase not in self.nodemap:
1151 raise LookupError(deltabase, self.indexfile,
1129 raise LookupError(deltabase, self.indexfile,
General Comments 0
You need to be logged in to leave comments. Login now