[PATCH 01 of 10] subrepo: use filesystem APIs via temporary vfs in "hgsubrepo" constrcutor
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Wed May 28 15:00:13 UTC 2014
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1401288802 -32400
# Wed May 28 23:53:22 2014 +0900
# Node ID 25cb27f9fa274069475fc8d1a129a272d9d7e147
# Parent 652e07debf10193f4973a48ead96a95e81d0a55b
subrepo: use filesystem APIs via temporary vfs in "hgsubrepo" constrcutor
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -11,7 +11,7 @@ import stat, subprocess, tarfile
from i18n import _
import config, util, node, error, cmdutil, bookmarks, match as matchmod
import phases
-import pathutil
+import pathutil, scmutil
hg = None
propertycache = util.propertycache
@@ -511,12 +511,12 @@ class hgsubrepo(abstractsubrepo):
self._path = path
self._state = state
r = ctx._repo
- root = r.wjoin(path)
+ vfs = scmutil.vfs(r.wjoin(path))
create = False
- if not os.path.exists(os.path.join(root, '.hg')):
+ if not vfs.exists('.hg'):
create = True
- util.makedirs(root)
- self._repo = hg.repository(r.baseui, root, create=create)
+ vfs.makedirs()
+ self._repo = hg.repository(r.baseui, vfs.base, create=create)
for s, k in [('ui', 'commitsubrepos')]:
v = r.ui.config(s, k)
if v:
More information about the Mercurial-devel
mailing list