mercurial/utils/resourceutil.py
changeset 44029 bba9149adc14
parent 44028 42a897bf678c
child 44152 a90039b07343
--- a/mercurial/utils/resourceutil.py	Sun Dec 29 20:32:56 2019 -0500
+++ b/mercurial/utils/resourceutil.py	Sun Dec 29 20:35:34 2019 -0500
@@ -55,6 +55,10 @@
             pycompat.sysstr(package), encoding.strfromlocal(name)
         )
 
+    def contents(package):
+        for r in resources.contents(pycompat.sysstr(package)):
+            yield encoding.strtolocal(r)
+
 
 except (ImportError, AttributeError):
 
@@ -72,3 +76,9 @@
             return os.path.isfile(pycompat.fsdecode(path))
         except (IOError, OSError):
             return False
+
+    def contents(package):
+        path = pycompat.fsdecode(_package_path(package))
+
+        for p in os.listdir(path):
+            yield pycompat.fsencode(p)