diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -522,7 +522,7 @@ class hgsubrepo(abstractsubrepo): self._state = state r = ctx._repo root = r.wjoin(path) - create = not os.path.exists(os.path.join(root, '.hg')) + create = not r.wvfs.exists('%s/.hg' % path) self._repo = hg.repository(r.baseui, root, create=create) for s, k in [('ui', 'commitsubrepos')]: v = r.ui.config(s, k)