mercurial/subrepo.py
branchstable
changeset 41583 87a6e3c953e0
parent 41458 83377b4b4ae0
child 41679 91701785c2c5
equal deleted inserted replaced
41460:8b2892d5a9f2 41583:87a6e3c953e0
   403 class hgsubrepo(abstractsubrepo):
   403 class hgsubrepo(abstractsubrepo):
   404     def __init__(self, ctx, path, state, allowcreate):
   404     def __init__(self, ctx, path, state, allowcreate):
   405         super(hgsubrepo, self).__init__(ctx, path)
   405         super(hgsubrepo, self).__init__(ctx, path)
   406         self._state = state
   406         self._state = state
   407         r = ctx.repo()
   407         r = ctx.repo()
   408         root = r.wjoin(path)
   408         root = r.wjoin(util.localpath(path))
   409         create = allowcreate and not r.wvfs.exists('%s/.hg' % path)
   409         create = allowcreate and not r.wvfs.exists('%s/.hg' % path)
   410         # repository constructor does expand variables in path, which is
   410         # repository constructor does expand variables in path, which is
   411         # unsafe since subrepo path might come from untrusted source.
   411         # unsafe since subrepo path might come from untrusted source.
   412         if os.path.realpath(util.expandpath(root)) != root:
   412         if os.path.realpath(util.expandpath(root)) != root:
   413             raise error.Abort(_('subrepo path contains illegal component: %s')
   413             raise error.Abort(_('subrepo path contains illegal component: %s')