changeset 31543:d5758760c0f4

shelve: use tryunlink
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 21 Mar 2017 06:50:28 -0700
parents fad440db3565
children 8a32d6352196
files hgext/shelve.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Tue Mar 21 06:50:28 2017 -0700
+++ b/hgext/shelve.py	Tue Mar 21 06:50:28 2017 -0700
@@ -236,11 +236,7 @@
             continue
         base = f[:-(1 + len(patchextension))]
         for ext in shelvefileextensions:
-            try:
-                vfs.unlink(base + '.' + ext)
-            except OSError as err:
-                if err.errno != errno.ENOENT:
-                    raise
+            vfs.tryunlink(base + '.' + ext)
 
 def _aborttransaction(repo):
     '''Abort current transaction for shelve/unshelve, but keep dirstate