Patchwork [2,of,9] bookmarks: use "vfs.utime()" instead of "os.utime()"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 14, 2013, 4:16 p.m.
Message ID <661c03d3bd9642203a85.1381767362@juju>
Download mbox | patch
Permalink /patch/2759/
State Accepted
Commit af03279c766a4c3d21129d466271ca12085f6b97
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 661c03d3bd9642203a8543b534237fa474e5bc06
# Parent  70fd2cb4166fe90b4cc09b4f0bd76a2706ffbedc
bookmarks: use "vfs.utime()" instead of "os.utime()"

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -8,7 +8,7 @@ 
 from mercurial.i18n import _
 from mercurial.node import hex
 from mercurial import encoding, error, util, obsolete
-import errno, os
+import errno
 
 class bmstore(dict):
     """Storage for bookmarks.
@@ -70,7 +70,7 @@ 
 
             # touch 00changelog.i so hgweb reloads bookmarks (no lock needed)
             try:
-                os.utime(repo.sjoin('00changelog.i'), None)
+                repo.svfs.utime('00changelog.i', None)
             except OSError:
                 pass
 
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -274,6 +274,9 @@ 
     def unlink(self, path=None):
         return util.unlink(self.join(path))
 
+    def utime(self, path=None, t=None):
+        return os.utime(self.join(path), t)
+
 class vfs(abstractvfs):
     '''Operate files relative to a base directory