shelve: use listdir() instead of readdir() when we don't need stat information
Differential Revision: https://phab.mercurial-scm.org/D9737
--- a/mercurial/shelve.py Fri Jan 08 23:08:37 2021 -0800
+++ b/mercurial/shelve.py Mon Jan 11 10:35:52 2021 -0800
@@ -617,14 +617,14 @@
def listshelves(repo):
"""return all shelves in repo as list of (time, name)"""
try:
- names = repo.vfs.readdir(shelvedir)
+ names = repo.vfs.listdir(shelvedir)
except OSError as err:
if err.errno != errno.ENOENT:
raise
return []
info = []
seen = set()
- for (filename, _type) in names:
+ for filename in names:
name = filename.rsplit(b'.', 1)[0]
if name in seen:
continue