[Commented On] D10868: revlog: list older-but-still-around file in `files`

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Tue Jun 15 11:40:03 UTC 2021


baymax added a comment.
baymax updated this revision to Diff 28568.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10868?vs=28551&id=28568

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10868/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10868

AFFECTED FILES
  mercurial/revlog.py
  mercurial/revlogutils/docket.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/docket.py b/mercurial/revlogutils/docket.py
--- a/mercurial/revlogutils/docket.py
+++ b/mercurial/revlogutils/docket.py
@@ -180,6 +180,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
@@ -196,6 +203,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
@@ -212,6 +226,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
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2928,10 +2928,13 @@
                 res.append(self._datafile)
         else:
             res.append(self._docket_file)
+            res.extend(self._docket.old_index_filepaths(include_empty=False))
             if self._docket.data_end:
                 res.append(self._datafile)
+            res.extend(self._docket.old_data_filepaths(include_empty=False))
             if self._docket.sidedata_end:
                 res.append(self._sidedatafile)
+            res.extend(self._docket.old_sidedata_filepaths(include_empty=False))
         return res
 
     def emitrevisions(



To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210615/c6235421/attachment-0002.html>


More information about the Mercurial-patches mailing list