comparison mercurial/revlog.py @ 47181:88bd08a6830f

revlog: simplify a conditionnal in _enforceinlinesize This is a gratuitous change to make things a bit easier to read. Differential Revision: https://phab.mercurial-scm.org/D10593
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:25:34 +0200
parents c9ae2e7fe154
children cacb08f357ed
comparison
equal deleted inserted replaced
47180:c9ae2e7fe154 47181:88bd08a6830f
1954 This should be called after revisions are added to the revlog. If the 1954 This should be called after revisions are added to the revlog. If the
1955 revlog has grown too large to be an inline revlog, it will convert it 1955 revlog has grown too large to be an inline revlog, it will convert it
1956 to use multiple index and data files. 1956 to use multiple index and data files.
1957 """ 1957 """
1958 tiprev = len(self) - 1 1958 tiprev = len(self) - 1
1959 if ( 1959 total_size = self.start(tiprev) + self.length(tiprev)
1960 not self._inline 1960 if not self._inline or total_size < _maxinline:
1961 or (self.start(tiprev) + self.length(tiprev)) < _maxinline
1962 ):
1963 return 1961 return
1964 1962
1965 troffset = tr.findoffset(self._indexfile) 1963 troffset = tr.findoffset(self._indexfile)
1966 if troffset is None: 1964 if troffset is None:
1967 raise error.RevlogError( 1965 raise error.RevlogError(