comparison mercurial/statichttprepo.py @ 46907:ffd3e823a7e5

urlutil: extract `url` related code from `util` 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/D10374
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 12 Apr 2021 03:01:04 +0200
parents d4ba4d51f85f
children d00177d08139
comparison
equal deleted inserted replaced
46906:33524c46a092 46907:ffd3e823a7e5
24 pycompat, 24 pycompat,
25 url, 25 url,
26 util, 26 util,
27 vfs as vfsmod, 27 vfs as vfsmod,
28 ) 28 )
29 from .utils import (
30 urlutil,
31 )
29 32
30 urlerr = util.urlerr 33 urlerr = util.urlerr
31 urlreq = util.urlreq 34 urlreq = util.urlreq
32 35
33 36
160 def __init__(self, ui, path): 163 def __init__(self, ui, path):
161 self._url = path 164 self._url = path
162 self.ui = ui 165 self.ui = ui
163 166
164 self.root = path 167 self.root = path
165 u = util.url(path.rstrip(b'/') + b"/.hg") 168 u = urlutil.url(path.rstrip(b'/') + b"/.hg")
166 self.path, authinfo = u.authinfo() 169 self.path, authinfo = u.authinfo()
167 170
168 vfsclass = build_opener(ui, authinfo) 171 vfsclass = build_opener(ui, authinfo)
169 self.vfs = vfsclass(self.path) 172 self.vfs = vfsclass(self.path)
170 self.cachevfs = vfsclass(self.vfs.join(b'cache')) 173 self.cachevfs = vfsclass(self.vfs.join(b'cache'))