[PATCH 08 of 14] bookmarks: use tryunlink

Ryan McElroy rm at fb.com
Mon Mar 20 22:10:51 EDT 2017


# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1490059858 25200
#      Mon Mar 20 18:30:58 2017 -0700
# Node ID 026786cf8915816fcf65dc293d92f04c1f566a91
# Parent  79c8e7ca7cb92d208c4c72454f06f11e6ef99d49
bookmarks: use tryunlink

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -131,11 +131,7 @@ class bmstore(dict):
                 finally:
                     f.close()
             else:
-                try:
-                    self._repo.vfs.unlink('bookmarks.current')
-                except OSError as inst:
-                    if inst.errno != errno.ENOENT:
-                        raise
+                self._repo.vfs.tryunlink('bookmarks.current')
         self._aclean = True
 
     def _write(self, fp):


More information about the Mercurial-devel mailing list