# HG changeset patch # User Martin von Zweigbergk # Date 1610390152 28800 # Node ID e33266b916be3525769675f95bb6e84f6c3a5435 # Parent c062874a35dbc1a68e2f28f14857f509f8f7b197 shelve: use listdir() instead of readdir() when we don't need stat information Differential Revision: https://phab.mercurial-scm.org/D9737 diff -r c062874a35db -r e33266b916be mercurial/shelve.py --- 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