Mercurial > public > mercurial-scm > hg
diff mercurial/revlogutils/docket.py @ 47455:f93a867a6486
revlog: list older-but-still-around file in `files`
These older files will eventually be removed, but we have to take them in account until they are. So we update `files` to keep fncache happy.
Differential Revision: https://phab.mercurial-scm.org/D10868
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 09 Jun 2021 19:47:29 +0200 |
parents | 865c260d7163 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/mercurial/revlogutils/docket.py Sat May 29 00:11:12 2021 +0200 +++ b/mercurial/revlogutils/docket.py Wed Jun 09 19:47:29 2021 +0200 @@ -182,6 +182,13 @@ self._index_uuid = make_uid() return self.index_filepath() + def old_index_filepaths(self, include_empty=True): + """yield file path to older index files associated to this docket""" + # very simplistic version at first + for uuid, size in self._older_index_uuids: + if include_empty or size > 0: + yield b"%s-%s.idx" % (self._radix, uuid) + def data_filepath(self): """file path to the current data file associated to this docket""" # very simplistic version at first @@ -198,6 +205,13 @@ self._data_uuid = make_uid() return self.data_filepath() + def old_data_filepaths(self, include_empty=True): + """yield file path to older data files associated to this docket""" + # very simplistic version at first + for uuid, size in self._older_data_uuids: + if include_empty or size > 0: + yield b"%s-%s.dat" % (self._radix, uuid) + def sidedata_filepath(self): """file path to the current sidedata file associated to this docket""" # very simplistic version at first @@ -214,6 +228,13 @@ self._sidedata_uuid = make_uid() return self.sidedata_filepath() + def old_sidedata_filepaths(self, include_empty=True): + """yield file path to older sidedata files associated to this docket""" + # very simplistic version at first + for uuid, size in self._older_sidedata_uuids: + if include_empty or size > 0: + yield b"%s-%s.sda" % (self._radix, uuid) + @property def index_end(self): return self._index_end