comparison mercurial/hg.py @ 49750:f075a9463ee7

peer: use a dedicated name for the `peer` constructor We want to change the argument it takes, so we rather make them different function.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 02 Dec 2022 18:04:51 +0100
parents be3fcd9e5e52
children ec30fe6917ec
comparison
equal deleted inserted replaced
49749:be3fcd9e5e52 49750:f075a9463ee7
166 if isinstance(repo, bytes): 166 if isinstance(repo, bytes):
167 u = urlutil.url(repo) 167 u = urlutil.url(repo)
168 scheme = u.scheme or b'file' 168 scheme = u.scheme or b'file'
169 if scheme in peer_schemes: 169 if scheme in peer_schemes:
170 cls = peer_schemes[scheme] 170 cls = peer_schemes[scheme]
171 cls.make_peer # make sure we load the module
171 elif scheme in repo_schemes: 172 elif scheme in repo_schemes:
172 cls = repo_schemes[scheme] 173 cls = repo_schemes[scheme]
174 cls.instance # make sure we load the module
173 else: 175 else:
174 cls = LocalFactory 176 cls = LocalFactory
175 cls.instance # make sure we load the module
176 if util.safehasattr(cls, 'islocal'): 177 if util.safehasattr(cls, 'islocal'):
177 return cls.islocal(repo) # pytype: disable=module-attr 178 return cls.islocal(repo) # pytype: disable=module-attr
178 return False 179 return False
179 repo.ui.deprecwarn(b"use obj.local() instead of islocal(obj)", b"6.4") 180 repo.ui.deprecwarn(b"use obj.local() instead of islocal(obj)", b"6.4")
180 return repo.local() 181 return repo.local()
251 path = path.loc # pytype: disable=attribute-error 252 path = path.loc # pytype: disable=attribute-error
252 else: 253 else:
253 scheme = urlutil.url(path).scheme 254 scheme = urlutil.url(path).scheme
254 if scheme in peer_schemes: 255 if scheme in peer_schemes:
255 cls = peer_schemes[scheme] 256 cls = peer_schemes[scheme]
256 peer = cls.instance( 257 peer = cls.make_peer(
257 rui, 258 rui,
258 path, 259 path,
259 create, 260 create,
260 intents=intents, 261 intents=intents,
261 createopts=createopts, 262 createopts=createopts,