Patchwork [1,of,9] bookmarks: use "vfs.unlink()" instead of "util.unlink()"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 14, 2013, 4:16 p.m.
Message ID <70fd2cb4166fe90b4cc0.1381767361@juju>
Download mbox | patch
Permalink /patch/2761/
State Accepted
Commit 37c0d93fb16657010df512b0bee84c74cd65020e
Headers show

Comments

Katsunori FUJIWARA - Oct. 14, 2013, 4:16 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1381765864 -32400
#      Tue Oct 15 00:51:04 2013 +0900
# Node ID 70fd2cb4166fe90b4cc09b4f0bd76a2706ffbedc
# Parent  1b2f9d36953e6ed384a044c1e73cb3a1aa072004
bookmarks: use "vfs.unlink()" instead of "util.unlink()"

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -126,7 +126,7 @@ 
     wlock = repo.wlock()
     try:
         try:
-            util.unlink(repo.join('bookmarks.current'))
+            repo.vfs.unlink('bookmarks.current')
             repo._bookmarkcurrent = None
         except OSError, inst:
             if inst.errno != errno.ENOENT:
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -271,6 +271,9 @@ 
     def stat(self, path=None):
         return os.stat(self.join(path))
 
+    def unlink(self, path=None):
+        return util.unlink(self.join(path))
+
 class vfs(abstractvfs):
     '''Operate files relative to a base directory