changeset 20084:a3378a1b0a05

transaction: unlink target file via vfs Before this patch, unlink target file is once opened before unlinking, because "opener" before vfs migration doesn't have "unlink()" function. This patch uses "vfs.unlink()" instead of "open()" and "fp.name".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 12 Nov 2013 16:23:52 +0900
parents c69e5911888d
children 589d6bb5b18d
files mercurial/transaction.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Sat Nov 09 14:50:58 2013 +0100
+++ b/mercurial/transaction.py	Tue Nov 12 16:23:52 2013 +0900
@@ -35,10 +35,7 @@
                 raise
         else:
             try:
-                fp = opener(f)
-                fn = fp.name
-                fp.close()
-                util.unlink(fn)
+                opener.unlink(f)
             except (IOError, OSError), inst:
                 if inst.errno != errno.ENOENT:
                     raise