mercurial/store.py
changeset 50514 0925eaf09c8b
parent 50513 5a62d56e3955
child 50627 e1ee6910f6bc
--- a/mercurial/store.py	Sun May 21 02:16:24 2023 +0200
+++ b/mercurial/store.py	Sun May 21 02:29:33 2023 +0200
@@ -685,13 +685,22 @@
                     details=file_details,
                 )
 
-    def top_entries(self, phase=False) -> Generator[BaseStoreEntry, None, None]:
+    def top_entries(
+        self, phase=False, obsolescence=False
+    ) -> Generator[BaseStoreEntry, None, None]:
         if phase and self.vfs.exists(b'phaseroots'):
             yield SimpleStoreEntry(
                 entry_path=b'phaseroots',
                 is_volatile=True,
             )
 
+        if obsolescence and self.vfs.exists(b'obsstore'):
+            # XXX if we had the file size it could be non-volatile
+            yield SimpleStoreEntry(
+                entry_path=b'obsstore',
+                is_volatile=True,
+            )
+
         files = reversed(self._walk(b'', False))
 
         changelogs = collections.defaultdict(dict)
@@ -733,7 +742,7 @@
                 )
 
     def walk(
-        self, matcher=None, phase=False
+        self, matcher=None, phase=False, obsolescence=False
     ) -> Generator[BaseStoreEntry, None, None]:
         """return files related to data storage (ie: revlogs)
 
@@ -745,7 +754,7 @@
         # yield data files first
         for x in self.data_entries(matcher):
             yield x
-        for x in self.top_entries(phase=phase):
+        for x in self.top_entries(phase=phase, obsolescence=obsolescence):
             yield x
 
     def copylist(self):