indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This matches what we did for the SSH protocol handler in
  https://phab.mercurial-scm.org/rHGac33dc94e1d53cf3fae22fd7e7c07805300ab42a.
  
  .. api::
  
    HTTP protocol handlers now advertises its internal name as
    ``http-v1`` instead of ``http``.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2219

AFFECTED FILES
  mercurial/wireproto.py
  mercurial/wireprotoserver.py

CHANGE DETAILS

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -112,7 +112,7 @@
 
     @property
     def name(self):
-        return 'http'
+        return 'http-v1'
 
     def getargs(self, args):
         knownargs = self._args()
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -778,7 +778,7 @@
         caps.append('bundle2=' + urlreq.quote(capsblob))
     caps.append('unbundle=%s' % ','.join(bundle2.bundlepriority))
 
-    if proto.name == 'http':
+    if proto.name == 'http-v1':
         caps.append('httpheader=%d' %
                     repo.ui.configint('server', 'maxhttpheaderlen'))
         if repo.ui.configbool('experimental', 'httppostargs'):
@@ -852,7 +852,7 @@
 
     if not bundle1allowed(repo, 'pull'):
         if not exchange.bundle2requested(opts.get('bundlecaps')):
-            if proto.name == 'http':
+            if proto.name == 'http-v1':
                 return ooberror(bundle2required)
             raise error.Abort(bundle2requiredmain,
                               hint=bundle2requiredhint)
@@ -878,7 +878,7 @@
     except error.Abort as exc:
         # cleanly forward Abort error to the client
         if not exchange.bundle2requested(opts.get('bundlecaps')):
-            if proto.name == 'http':
+            if proto.name == 'http-v1':
                 return ooberror(str(exc) + '\n')
             raise # cannot do better for bundle1 + ssh
         # bundle2 request expect a bundle2 reply
@@ -983,7 +983,7 @@
                 gen = exchange.readbundle(repo.ui, fp, None)
                 if (isinstance(gen, changegroupmod.cg1unpacker)
                     and not bundle1allowed(repo, 'push')):
-                    if proto.name == 'http':
+                    if proto.name == 'http-v1':
                         # need to special case http because stderr do not get 
to
                         # the http client on failed push so we need to abuse
                         # some other error type to make sure the message get to



To: indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to