mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
remotefilelog: handle missing directory
Summary: Wez noticed that when /var/cache/hgcache/<repo>/packs/manifest was missing, `hg repack` would fail, not repacking anything. Let's fix the offending code to properly ignore the missing directory. Reviewed By: quark-zju Differential Revision: D17120206 fbshipit-source-id: 7a7aebac717e5f128565ea2f8d50ffaeda4563f9
This commit is contained in:
parent
490a99230c
commit
689256b99d
@ -704,10 +704,14 @@ def _cleanupoldpacks(ui, packpath, limit):
|
||||
|
||||
def _listpackfiles(path):
|
||||
packs = []
|
||||
for f in os.listdir(path):
|
||||
_, ext = os.path.splitext(f)
|
||||
if ext.endswith("pack"):
|
||||
packs.append(os.path.join(packpath, f))
|
||||
try:
|
||||
for f in os.listdir(path):
|
||||
_, ext = os.path.splitext(f)
|
||||
if ext.endswith("pack"):
|
||||
packs.append(os.path.join(packpath, f))
|
||||
except OSError as ex:
|
||||
if ex.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
return packs
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user