Patchwork [9,of,9] store: use "vfs.exists()" instead of "os.path.exists()"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 14, 2013, 4:16 p.m.
Message ID <485bc40b55e132c8554d.1381767369@juju>
Download mbox | patch
Permalink /patch/2767/
State Accepted
Commit ca875b271ac340d62855a36f3e31578ee33bfd37
Headers show

Comments

Katsunori FUJIWARA - Oct. 14, 2013, 4:16 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1381765865 -32400
#      Tue Oct 15 00:51:05 2013 +0900
# Node ID 485bc40b55e132c8554d47dac980ff8644858606
# Parent  62800e7add063b8060396c4188ab87ef2bbe316d
store: use "vfs.exists()" instead of "os.path.exists()"
Matt Mackall - Oct. 14, 2013, 6:59 p.m.
On Tue, 2013-10-15 at 01:16 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1381765865 -32400
> #      Tue Oct 15 00:51:05 2013 +0900
> # Node ID 485bc40b55e132c8554d47dac980ff8644858606
> # Parent  62800e7add063b8060396c4188ab87ef2bbe316d
> store: use "vfs.exists()" instead of "os.path.exists()"

These are queued for default, thanks.

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -344,12 +344,12 @@ 
         '''Checks if the store contains path'''
         path = "/".join(("data", path))
         # file?
-        if os.path.exists(self.join(path + ".i")):
+        if self.vfs.exists(path + ".i"):
             return True
         # dir?
         if not path.endswith("/"):
             path = path + "/"
-        return os.path.exists(self.join(path))
+        return self.vfs.exists(path)
 
 class encodedstore(basicstore):
     def __init__(self, path, vfstype):