Mercurial > hg
comparison mercurial/revlog.py @ 35974:9ba1d0c724e2
revlog: rename 'self.checkinlinesize' into '_enforceinlinesize'
The name change has two motivations:
1) The function has no external caller, so we move it to protected space.
2) the function does more than checking it also split the data if we have more
data than 'inline' supports.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 05 Feb 2018 18:04:40 +0100 |
parents | 4d66993bdcff |
children | f574cc00831a |
comparison
equal
deleted
inserted
replaced
35973:4d66993bdcff | 35974:9ba1d0c724e2 |
---|---|
1832 if revornode is None: | 1832 if revornode is None: |
1833 revornode = templatefilters.short(hex(node)) | 1833 revornode = templatefilters.short(hex(node)) |
1834 raise RevlogError(_("integrity check failed on %s:%s") | 1834 raise RevlogError(_("integrity check failed on %s:%s") |
1835 % (self.indexfile, pycompat.bytestr(revornode))) | 1835 % (self.indexfile, pycompat.bytestr(revornode))) |
1836 | 1836 |
1837 def checkinlinesize(self, tr, fp=None): | 1837 def _enforceinlinesize(self, tr, fp=None): |
1838 """Check if the revlog is too big for inline and convert if so. | 1838 """Check if the revlog is too big for inline and convert if so. |
1839 | 1839 |
1840 This should be called after revisions are added to the revlog. If the | 1840 This should be called after revisions are added to the revlog. If the |
1841 revlog has grown too large to be an inline revlog, it will convert it | 1841 revlog has grown too large to be an inline revlog, it will convert it |
1842 to use multiple index and data files. | 1842 to use multiple index and data files. |
2143 offset += curr * self._io.size | 2143 offset += curr * self._io.size |
2144 transaction.add(self.indexfile, offset, curr) | 2144 transaction.add(self.indexfile, offset, curr) |
2145 ifh.write(entry) | 2145 ifh.write(entry) |
2146 ifh.write(data[0]) | 2146 ifh.write(data[0]) |
2147 ifh.write(data[1]) | 2147 ifh.write(data[1]) |
2148 self.checkinlinesize(transaction, ifh) | 2148 self._enforceinlinesize(transaction, ifh) |
2149 | 2149 |
2150 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None): | 2150 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None): |
2151 """ | 2151 """ |
2152 add a delta group | 2152 add a delta group |
2153 | 2153 |