##// END OF EJS Templates
revlog: add punched revision flag...
Vishakh H -
r11745:138c055e default
parent child Browse files
Show More
@@ -30,6 +30,8 b' REVLOGNGINLINEDATA = (1 << 16)'
30 30 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
31 31 REVLOG_DEFAULT_FORMAT = REVLOGNG
32 32 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
33 REVIDX_PUNCHED_FLAG = 2
34 REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG
33 35
34 36 # amount of data read unconditionally, should be >= 4
35 37 # when not inline: threshold for using lazy index
@@ -1022,9 +1024,9 b' class revlog(object):'
1022 1024 base = self.base(rev)
1023 1025
1024 1026 # check rev flags
1025 if self.flags(rev):
1027 if self.flags(rev) & ~REVIDX_KNOWN_FLAGS:
1026 1028 raise RevlogError(_('incompatible revision flag %x') %
1027 (self.flags(rev)))
1029 (self.flags(rev) & ~REVIDX_KNOWN_FLAGS))
1028 1030
1029 1031 # do we have useful data cached?
1030 1032 if self._cache and self._cache[1] >= base and self._cache[1] < rev:
@@ -1039,7 +1041,8 b' class revlog(object):'
1039 1041 bins = [self._chunk(r) for r in xrange(base + 1, rev + 1)]
1040 1042 text = mdiff.patches(text, bins)
1041 1043 p1, p2 = self.parents(node)
1042 if node != hash(text, p1, p2):
1044 if (node != hash(text, p1, p2) and
1045 not (self.flags(rev) & REVIDX_PUNCHED_FLAG)):
1043 1046 raise RevlogError(_("integrity check failed on %s:%d")
1044 1047 % (self.indexfile, rev))
1045 1048
@@ -1125,7 +1128,9 b' class revlog(object):'
1125 1128
1126 1129 # full versions are inserted when the needed deltas
1127 1130 # become comparable to the uncompressed text
1128 if not curr or dist > len(text) * 2:
1131 # or the base revision is punched
1132 if (not curr or dist > len(text) * 2 or
1133 (self.flags(base) & REVIDX_PUNCHED_FLAG)):
1129 1134 data = compress(text)
1130 1135 l = len(data[1]) + len(data[0])
1131 1136 base = curr
General Comments 0
You need to be logged in to leave comments. Login now