Mercurial > hg-stable
changeset 46290:e33266b916be
shelve: use listdir() instead of readdir() when we don't need stat information
Differential Revision: https://phab.mercurial-scm.org/D9737
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 11 Jan 2021 10:35:52 -0800 |
parents | c062874a35db |
children | e2713c68b477 |
files | mercurial/shelve.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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