Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 41679:91701785c2c5
merge with stable
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 11 Feb 2019 11:18:37 -0500 |
parents | 0531dff73d0b 87a6e3c953e0 |
children | 980e05204ed8 |
comparison
equal
deleted
inserted
replaced
41678:9d0d8793e847 | 41679:91701785c2c5 |
---|---|
402 class hgsubrepo(abstractsubrepo): | 402 class hgsubrepo(abstractsubrepo): |
403 def __init__(self, ctx, path, state, allowcreate): | 403 def __init__(self, ctx, path, state, allowcreate): |
404 super(hgsubrepo, self).__init__(ctx, path) | 404 super(hgsubrepo, self).__init__(ctx, path) |
405 self._state = state | 405 self._state = state |
406 r = ctx.repo() | 406 r = ctx.repo() |
407 root = r.wjoin(path) | 407 root = r.wjoin(util.localpath(path)) |
408 create = allowcreate and not r.wvfs.exists('%s/.hg' % path) | 408 create = allowcreate and not r.wvfs.exists('%s/.hg' % path) |
409 # repository constructor does expand variables in path, which is | 409 # repository constructor does expand variables in path, which is |
410 # unsafe since subrepo path might come from untrusted source. | 410 # unsafe since subrepo path might come from untrusted source. |
411 if os.path.realpath(util.expandpath(root)) != root: | 411 if os.path.realpath(util.expandpath(root)) != root: |
412 raise error.Abort(_('subrepo path contains illegal component: %s') | 412 raise error.Abort(_('subrepo path contains illegal component: %s') |