comparison mercurial/interfaces/repository.py @ 49752:611ccb631cbc

peer: add a `path` attribute to peer It will start being set in the coming changesets.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Dec 2022 00:13:50 +0100
parents a6e2a668c746
children ff7134e03629
comparison
equal deleted inserted replaced
49751:a6e2a668c746 49752:611ccb631cbc
101 This is not a complete interface definition and should not be used 101 This is not a complete interface definition and should not be used
102 outside of this module. 102 outside of this module.
103 """ 103 """
104 104
105 ui = interfaceutil.Attribute("""ui.ui instance""") 105 ui = interfaceutil.Attribute("""ui.ui instance""")
106 path = interfaceutil.Attribute("""a urlutil.path instance or None""")
106 107
107 def url(): 108 def url():
108 """Returns a URL string representing this peer. 109 """Returns a URL string representing this peer.
109 110
110 Currently, implementations expose the raw URL used to construct the 111 Currently, implementations expose the raw URL used to construct the
385 class peer: 386 class peer:
386 """Base class for peer repositories.""" 387 """Base class for peer repositories."""
387 388
388 limitedarguments = False 389 limitedarguments = False
389 390
390 def __init__( 391 def __init__(self, ui, path=None):
391 self,
392 ui,
393 ):
394 self.ui = ui 392 self.ui = ui
393 self.path = path
395 394
396 def capable(self, name): 395 def capable(self, name):
397 caps = self.capabilities() 396 caps = self.capabilities()
398 if name in caps: 397 if name in caps:
399 return True 398 return True