D3401: wireproto: define HTTP version 2 protocol name in server module

2018-04-16 Thread indygreg (Gregory Szorc)
indygreg abandoned this revision.
indygreg added a comment.


  This one breaks tests.

REPOSITORY
  rHG Mercurial

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

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


D3401: wireproto: define HTTP version 2 protocol name in server module

2018-04-16 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  And subtly rename the canonical transport to "http-v2." I believe the
  key in the TRANSPORTS dict is only used internally. So the exact name
  should not matter.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/httppeer.py
  mercurial/wireprototypes.py
  mercurial/wireprotov2server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -27,7 +27,7 @@
 
 FRAMINGTYPE = b'application/mercurial-exp-framing-0005'
 
-HTTP_WIREPROTO_V2 = wireprototypes.HTTP_WIREPROTO_V2
+HTTP_WIREPROTO_V2 = b'exp-http-v2-0001'
 
 COMMANDS = wireprototypes.commanddict()
 
diff --git a/mercurial/wireprototypes.py b/mercurial/wireprototypes.py
--- a/mercurial/wireprototypes.py
+++ b/mercurial/wireprototypes.py
@@ -22,7 +22,6 @@
 # These are advertised over the wire. Increment the counters at the end
 # to reflect BC breakages.
 SSHV2 = 'exp-ssh-v2-0001'
-HTTP_WIREPROTO_V2 = 'exp-http-v2-0001'
 
 # All available wire protocol transports.
 TRANSPORTS = {
@@ -39,7 +38,7 @@
 'transport': 'http',
 'version': 1,
 },
-HTTP_WIREPROTO_V2: {
+'http-v2': {
 'transport': 'http',
 'version': 2,
 }
diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -33,7 +33,6 @@
 url as urlmod,
 util,
 wireprotoframing,
-wireprototypes,
 wireprotov1peer,
 wireprotov2peer,
 wireprotov2server,
@@ -815,7 +814,7 @@
 #Integer priority for the service. If we could choose from multiple
 #services, we choose the one with the highest priority.
 API_PEERS = {
-wireprototypes.HTTP_WIREPROTO_V2: {
+wireprotov2server.HTTP_WIREPROTO_V2: {
 'init': httpv2peer,
 'priority': 50,
 },



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