Patchwork D9737: shelve: use listdir() instead of readdir() when we don't need stat information

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 10:49 p.m.
Message ID <differential-rev-PHID-DREV-eddoogp44tiqo67ujias-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48048/
State Superseded
Headers show

Comments

phabricator - Jan. 12, 2021, 10:49 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9737

AFFECTED FILES
  mercurial/shelve.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -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