mercurial/sshpeer.py
changeset 33806 dedab036215d
parent 33804 1f8460b55986
child 34105 c037fd655b47
equal deleted inserted replaced
33805:f913e90f15a0 33806:dedab036215d
    11 
    11 
    12 from .i18n import _
    12 from .i18n import _
    13 from . import (
    13 from . import (
    14     error,
    14     error,
    15     pycompat,
    15     pycompat,
    16     repository,
       
    17     util,
    16     util,
    18     wireproto,
    17     wireproto,
    19 )
    18 )
    20 
    19 
    21 def _serverquote(s):
    20 def _serverquote(s):
   113         return self._main.close()
   112         return self._main.close()
   114 
   113 
   115     def flush(self):
   114     def flush(self):
   116         return self._main.flush()
   115         return self._main.flush()
   117 
   116 
   118 class sshpeer(wireproto.wirepeer, repository.legacypeer):
   117 class sshpeer(wireproto.wirepeer):
   119     def __init__(self, ui, path, create=False):
   118     def __init__(self, ui, path, create=False):
   120         self._url = path
   119         self._url = path
   121         self._ui = ui
   120         self._ui = ui
   122         self._pipeo = self._pipei = self._pipee = None
   121         self._pipeo = self._pipei = self._pipee = None
   123 
   122 
   148             res = ui.system(cmd, blockedtag='sshpeer')
   147             res = ui.system(cmd, blockedtag='sshpeer')
   149             if res != 0:
   148             if res != 0:
   150                 self._abort(error.RepoError(_("could not create remote repo")))
   149                 self._abort(error.RepoError(_("could not create remote repo")))
   151 
   150 
   152         self._validaterepo(sshcmd, args, remotecmd)
   151         self._validaterepo(sshcmd, args, remotecmd)
   153 
       
   154         # TODO remove this alias once peerrepository inheritance is removed.
       
   155         self._capabilities = self.capabilities
       
   156 
   152 
   157     # Begin of _basepeer interface.
   153     # Begin of _basepeer interface.
   158 
   154 
   159     @util.propertycache
   155     @util.propertycache
   160     def ui(self):
   156     def ui(self):