##// 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 34 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
35 35
36 36 # revlog index flags
37 REVIDX_PUNCHED_FLAG = 2
38 REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG
37 REVIDX_KNOWN_FLAGS = 0
39 38
40 39 # max size of revlog with inline data
41 40 _maxinline = 131072
@@ -891,8 +890,7 b' class revlog(object):'
891 890
892 891 def _checkhash(self, text, node, rev):
893 892 p1, p2 = self.parents(node)
894 if (node != hash(text, p1, p2) and
895 not (self.flags(rev) & REVIDX_PUNCHED_FLAG)):
893 if node != hash(text, p1, p2):
896 894 raise RevlogError(_("integrity check failed on %s:%d")
897 895 % (self.indexfile, rev))
898 896 return text
@@ -946,8 +944,7 b' class revlog(object):'
946 944 cachedelta - an optional precomputed delta
947 945 """
948 946 node = hash(text, p1, p2)
949 if (node in self.nodemap and
950 (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
947 if node in self.nodemap:
951 948 return node
952 949
953 950 dfh = None
@@ -1009,14 +1006,12 b' class revlog(object):'
1009 1006
1010 1007 # full versions are inserted when the needed deltas
1011 1008 # become comparable to the uncompressed text
1012 # or the base revision is punched
1013 1009 if text is None:
1014 1010 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
1015 1011 cachedelta[1])
1016 1012 else:
1017 1013 textlen = len(text)
1018 if (d is None or dist > textlen * 2 or
1019 (self.flags(base) & REVIDX_PUNCHED_FLAG)):
1014 if d is None or dist > textlen * 2:
1020 1015 text = buildtext()
1021 1016 data = compress(text)
1022 1017 l = len(data[1]) + len(data[0])
@@ -1120,32 +1115,15 b' class revlog(object):'
1120 1115 delta = chunkdata['delta']
1121 1116
1122 1117 link = linkmapper(cs)
1123 if (node in self.nodemap and
1124 (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
1118 if node in self.nodemap:
1125 1119 # this can happen if two branches make the same change
1126 1120 chain = node
1127 1121 continue
1128 1122
1129 1123 for p in (p1, p2):
1130 1124 if not p in self.nodemap:
1131 if self._shallow:
1132 # add null entries for missing parents
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'))
1125 raise LookupError(p, self.indexfile,
1126 _('unknown parent'))
1149 1127
1150 1128 if deltabase not in self.nodemap:
1151 1129 raise LookupError(deltabase, self.indexfile,
General Comments 0
You need to be logged in to leave comments. Login now