comparison mercurial/revset.py @ 46908:4452cb788404

urlutil: extract `parseurl` from `hg` into the new module The new module is well fitting for this new code. And this will be useful to make the gathered code collaborate more later. Differential Revision: https://phab.mercurial-scm.org/D10375
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 12 Apr 2021 06:34:54 +0200
parents d4ba4d51f85f
children 9519312ecd81
comparison
equal deleted inserted replaced
46907:ffd3e823a7e5 46908:4452cb788404
39 util, 39 util,
40 ) 40 )
41 from .utils import ( 41 from .utils import (
42 dateutil, 42 dateutil,
43 stringutil, 43 stringutil,
44 urlutil,
44 ) 45 )
45 46
46 # helpers for processing parsed tree 47 # helpers for processing parsed tree
47 getsymbol = revsetlang.getsymbol 48 getsymbol = revsetlang.getsymbol
48 getstring = revsetlang.getstring 49 getstring = revsetlang.getstring
2120 dest = b'' 2121 dest = b''
2121 if len(l) > 1: 2122 if len(l) > 1:
2122 # i18n: "remote" is a keyword 2123 # i18n: "remote" is a keyword
2123 dest = getstring(l[1], _(b"remote requires a repository path")) 2124 dest = getstring(l[1], _(b"remote requires a repository path"))
2124 dest = repo.ui.expandpath(dest or b'default') 2125 dest = repo.ui.expandpath(dest or b'default')
2125 dest, branches = hg.parseurl(dest) 2126 dest, branches = urlutil.parseurl(dest)
2126 2127
2127 other = hg.peer(repo, {}, dest) 2128 other = hg.peer(repo, {}, dest)
2128 n = other.lookup(q) 2129 n = other.lookup(q)
2129 if n in repo: 2130 if n in repo:
2130 r = repo[n].rev() 2131 r = repo[n].rev()