comparison mercurial/revlog.py @ 26376:344a1621674b

revlog: add docstring for checkinlinesize() The name is deceptive: it does more than just "check." Add a docstring to clarify what's going on.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 27 Sep 2015 15:31:50 -0700
parents 836291420d53
children dfef0d3be65e
comparison
equal deleted inserted replaced
26375:3686fa2b8eee 26376:344a1621674b
1123 revornode = templatefilters.short(hex(node)) 1123 revornode = templatefilters.short(hex(node))
1124 raise RevlogError(_("integrity check failed on %s:%s") 1124 raise RevlogError(_("integrity check failed on %s:%s")
1125 % (self.indexfile, revornode)) 1125 % (self.indexfile, revornode))
1126 1126
1127 def checkinlinesize(self, tr, fp=None): 1127 def checkinlinesize(self, tr, fp=None):
1128 """Check if the revlog is too big for inline and convert if so.
1129
1130 This should be called after revisions are added to the revlog. If the
1131 revlog has grown too large to be an inline revlog, it will convert it
1132 to use multiple index and data files.
1133 """
1128 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline: 1134 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline:
1129 return 1135 return
1130 1136
1131 trinfo = tr.find(self.indexfile) 1137 trinfo = tr.find(self.indexfile)
1132 if trinfo is None: 1138 if trinfo is None: