comparison mercurial/revlog.py @ 10900:cf016c9831d1

revlog: factor out _maxinline global. This lets us change the threshold at which a *.d file will be split out, which should make it much easier to construct test cases that probe revlogs with a separate data file. (issue2137)
author Greg Ward <greg-hg@gerg.ca>
date Tue, 13 Apr 2010 17:58:38 -0400
parents adb6a291bbdb
children c9543bc6be16
comparison
equal deleted inserted replaced
10899:90112473b8ca 10900:cf016c9831d1
30 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA 30 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
31 REVLOG_DEFAULT_FORMAT = REVLOGNG 31 REVLOG_DEFAULT_FORMAT = REVLOGNG
32 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS 32 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
33 33
34 _prereadsize = 1048576 34 _prereadsize = 1048576
35
36 _maxinline = 131072 # max size of revlog with inline data
35 37
36 RevlogError = error.RevlogError 38 RevlogError = error.RevlogError
37 LookupError = error.LookupError 39 LookupError = error.LookupError
38 40
39 def getoffset(q): 41 def getoffset(q):
1034 1036
1035 self._cache = (node, rev, text) 1037 self._cache = (node, rev, text)
1036 return text 1038 return text
1037 1039
1038 def checkinlinesize(self, tr, fp=None): 1040 def checkinlinesize(self, tr, fp=None):
1039 if not self._inline or (self.start(-2) + self.length(-2)) < 131072: 1041 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline:
1040 return 1042 return
1041 1043
1042 trinfo = tr.find(self.indexfile) 1044 trinfo = tr.find(self.indexfile)
1043 if trinfo is None: 1045 if trinfo is None:
1044 raise RevlogError(_("%s not found in the transaction") 1046 raise RevlogError(_("%s not found in the transaction")