diff mercurial/sshpeer.py @ 37411:3e1688711efd

wireproto: turn client capabilities into sets, sorted on the wire Differential Revision: https://phab.mercurial-scm.org/D3169
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 06 Apr 2018 21:50:01 +0200
parents afcfdf53e4b5
children aacfca6f9767
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Wed Apr 04 13:43:52 2018 -0700
+++ b/mercurial/sshpeer.py	Fri Apr 06 21:50:01 2018 +0200
@@ -168,10 +168,10 @@
 
     Returns a list of capabilities that are supported by this client.
     """
-    protoparams = []
+    protoparams = set()
     comps = [e.wireprotosupport().name for e in
              util.compengines.supportedwireengines(util.CLIENTROLE)]
-    protoparams.append('comp=%s' % ','.join(comps))
+    protoparams.add('comp=%s' % ','.join(comps))
     return protoparams
 
 def _performhandshake(ui, stdin, stdout, stderr):
@@ -626,7 +626,8 @@
     # capabilities.
     if 'protocaps' in peer.capabilities():
         try:
-            peer._call("protocaps", caps=' '.join(_clientcapabilities()))
+            peer._call("protocaps",
+                       caps=' '.join(sorted(_clientcapabilities())))
         except IOError:
             peer._cleanup()
             raise error.RepoError(_('capability exchange failed'))