[PATCH 10 of 11] vfs: use tryunlink

Ryan McElroy rm at fb.com
Tue Mar 21 09:54:32 EDT 2017


# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1490104228 25200
#      Tue Mar 21 06:50:28 2017 -0700
# Node ID ba24c5cdac8654da7d0d510e3643226e69cef187
# Parent  684d201e116b65e6dff5f9494de064591da57b07
vfs: use tryunlink

diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -401,10 +401,7 @@ class vfs(abstractvfs):
     def symlink(self, src, dst):
         self.audit(dst)
         linkname = self.join(dst)
-        try:
-            os.unlink(linkname)
-        except OSError:
-            pass
+        util.tryunlink(linkname)
 
         util.makedirs(os.path.dirname(linkname), self.createmode)
 


More information about the Mercurial-devel mailing list