comparison mercurial/revset.py @ 46956:c5c2936f6fb2

revset: use `get_unique_pull_path` for `remote(?)` This one is also resolving path. For now we restrict the feature to a single destination. This might change in the future. Differential Revision: https://phab.mercurial-scm.org/D10422
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 14 Apr 2021 20:21:11 +0200
parents 9519312ecd81
children 1e2f2c782928
comparison
equal deleted inserted replaced
46955:3000f2100711 46956:c5c2936f6fb2
2119 2119
2120 dest = b'' 2120 dest = b''
2121 if len(l) > 1: 2121 if len(l) > 1:
2122 # i18n: "remote" is a keyword 2122 # i18n: "remote" is a keyword
2123 dest = getstring(l[1], _(b"remote requires a repository path")) 2123 dest = getstring(l[1], _(b"remote requires a repository path"))
2124 dest = repo.ui.expandpath(dest or b'default') 2124 if not dest:
2125 dest, branches = urlutil.parseurl(dest) 2125 dest = b'default'
2126 dest, branches = urlutil.get_unique_pull_path(
2127 b'remote', repo, repo.ui, dest
2128 )
2126 2129
2127 other = hg.peer(repo, {}, dest) 2130 other = hg.peer(repo, {}, dest)
2128 n = other.lookup(q) 2131 n = other.lookup(q)
2129 if n in repo: 2132 if n in repo:
2130 r = repo[n].rev() 2133 r = repo[n].rev()