comparison mercurial/revlog.py @ 44335:e41a164db7a9

nodemap: track the maximum revision tracked in the nodemap We need a simple way to detect when the on disk data contains less revision than the index we read from disk. The docket file is meant for this, we just had to start tracking that data. We should also try to detect strip operation, but we will deal with this in later changesets. Right now we are focusing on defining the API for index supporting persistent nodemap. Differential Revision: https://phab.mercurial-scm.org/D7888
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:50:14 +0100
parents 76a96e3a2bbb
children f7459da77f23
comparison
equal deleted inserted replaced
44334:6614b301ea58 44335:e41a164db7a9
637 and util.safehasattr(index, 'update_nodemap_data') 637 and util.safehasattr(index, 'update_nodemap_data')
638 ) 638 )
639 if use_nodemap: 639 if use_nodemap:
640 nodemap_data = nodemaputil.persisted_data(self) 640 nodemap_data = nodemaputil.persisted_data(self)
641 if nodemap_data is not None: 641 if nodemap_data is not None:
642 index.update_nodemap_data(nodemap_data[1]) 642 index.update_nodemap_data(*nodemap_data)
643 except (ValueError, IndexError): 643 except (ValueError, IndexError):
644 raise error.RevlogError( 644 raise error.RevlogError(
645 _(b"index %s is corrupted") % self.indexfile 645 _(b"index %s is corrupted") % self.indexfile
646 ) 646 )
647 self.index, self._chunkcache = d 647 self.index, self._chunkcache = d