equal
deleted
inserted
replaced
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') |