mercurial/hg.py
changeset 49707 aa36771ef505
parent 49701 1470a533d28a
child 49718 e64b1e9f4892
equal deleted inserted replaced
49706:f27fbb908b10 49707:aa36771ef505
   241 
   241 
   242 
   242 
   243 def peer(uiorrepo, opts, path, create=False, intents=None, createopts=None):
   243 def peer(uiorrepo, opts, path, create=False, intents=None, createopts=None):
   244     '''return a repository peer for the specified path'''
   244     '''return a repository peer for the specified path'''
   245     rui = remoteui(uiorrepo, opts)
   245     rui = remoteui(uiorrepo, opts)
   246     scheme = urlutil.url(path).scheme
   246     if util.safehasattr(path, 'url'):
       
   247         # this is a urlutil.path object
       
   248         scheme = path.url.scheme  # pytype: disable=attribute-error
       
   249         # XXX for now we don't do anything more than that
       
   250         path = path.loc  # pytype: disable=attribute-error
       
   251     else:
       
   252         scheme = urlutil.url(path).scheme
   247     if scheme in peer_schemes:
   253     if scheme in peer_schemes:
   248         cls = peer_schemes[scheme]
   254         cls = peer_schemes[scheme]
   249         peer = cls.instance(
   255         peer = cls.instance(
   250             rui,
   256             rui,
   251             path,
   257             path,