changeset 49586:636cd96806a7

shelve: add Shelf.changed_files for resolving changed files in a plugin
author Jason R. Coombs <jaraco@jaraco.com>
date Mon, 29 Aug 2022 14:11:26 -0400
parents 18282cf18aa2
children 8a8005025d1c
files mercurial/shelve.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/shelve.py	Mon Nov 14 10:59:09 2022 +0100
+++ b/mercurial/shelve.py	Mon Aug 29 14:11:26 2022 -0400
@@ -247,6 +247,14 @@
         for ext in shelvefileextensions:
             self.vfs.tryunlink(self.name + b'.' + ext)
 
+    def changed_files(self, ui, repo):
+        try:
+            ctx = repo.unfiltered()[self.readinfo()[b'node']]
+            return ctx.files()
+        except (FileNotFoundError, error.RepoLookupError):
+            filename = self.vfs.join(self.name + b'.patch')
+            return patch.changedfiles(ui, repo, filename)
+
 
 def _optimized_match(repo, node):
     """