diff mercurial/store.py @ 50472:9fdc28e21b68

store: introduce a EntryFile object to actually access file info For now a StoreEntry match a single file, but the goal is to eventually combine multiple file in a higher level Entry, so we need to introduce this distinction and use it first.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 08:56:40 +0200
parents 521fec115dad
children 5a2fb64d38b2
line wrap: on
line diff
--- a/mercurial/store.py	Mon May 15 08:56:23 2023 +0200
+++ b/mercurial/store.py	Mon May 15 08:56:40 2023 +0200
@@ -466,6 +466,24 @@
     is_volatile = attr.ib(default=False)
     file_size = attr.ib(default=None)
 
+    def files(self):
+        return [
+            StoreFile(
+                unencoded_path=self.unencoded_path,
+                file_size=self.file_size,
+                is_volatile=self.is_volatile,
+            )
+        ]
+
+
+@attr.s(slots=True)
+class StoreFile:
+    """a file matching an entry"""
+
+    unencoded_path = attr.ib()
+    file_size = attr.ib()
+    is_volatile = attr.ib(default=False)
+
 
 class basicstore:
     '''base class for local repository stores'''