mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
remotefilelog: use util.unlink instead of os.unlink
Summary: The former will always succeed on Windows, while the later raise an Exception when the file is opened elsewhere. Reviewed By: quark-zju Differential Revision: D15571023 fbshipit-source-id: b7ee739dce49f9a9ba5087ec785a6dc332eb88c8
This commit is contained in:
parent
a805a7acac
commit
34344946cd
@ -726,15 +726,15 @@ def _cleanupoldpacks(ui, packpath, limit):
|
||||
root, ext = os.path.splitext(f)
|
||||
try:
|
||||
if ext == datapack.PACKSUFFIX:
|
||||
os.unlink(root + datapack.INDEXSUFFIX)
|
||||
util.unlink(root + datapack.INDEXSUFFIX)
|
||||
else:
|
||||
os.unlink(root + historypack.INDEXSUFFIX)
|
||||
util.unlink(root + historypack.INDEXSUFFIX)
|
||||
except OSError as ex:
|
||||
if ex.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
try:
|
||||
os.unlink(f)
|
||||
util.unlink(f)
|
||||
except OSError as ex:
|
||||
if ex.errno != errno.ENOENT:
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user