[PATCH 1 of 8 V2] protocol: declare transport protocol name

Gregory Szorc gregory.szorc at gmail.com
Tue Nov 29 06:58:18 UTC 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1480394819 28800
#      Mon Nov 28 20:46:59 2016 -0800
# Node ID 05d19f908c3abf62e2ed6d453a8cd52bbc727408
# Parent  64b55bffc1c059eb4c11ca195b561ca8a287f59e
protocol: declare transport protocol name

We add an attribute to the HTTP and SSH protocol implementations
identifying the transport so future patches can conditionally
expose capabilities on a per-transport basis.

diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py
--- a/mercurial/hgweb/protocol.py
+++ b/mercurial/hgweb/protocol.py
@@ -30,6 +30,8 @@ class webproto(wireproto.abstractserverp
         self.req = req
         self.response = ''
         self.ui = ui
+        self.name = 'http'
+
     def getargs(self, args):
         knownargs = self._args()
         data = {}
diff --git a/mercurial/sshserver.py b/mercurial/sshserver.py
--- a/mercurial/sshserver.py
+++ b/mercurial/sshserver.py
@@ -26,6 +26,7 @@ class sshserver(wireproto.abstractserver
         self.lock = None
         self.fin = ui.fin
         self.fout = ui.fout
+        self.name = 'ssh'
 
         hook.redirect(True)
         ui.fout = repo.ui.fout = ui.ferr


More information about the Mercurial-devel mailing list