equal
deleted
inserted
replaced
166 def _clientcapabilities(): |
166 def _clientcapabilities(): |
167 """Return list of capabilities of this client. |
167 """Return list of capabilities of this client. |
168 |
168 |
169 Returns a list of capabilities that are supported by this client. |
169 Returns a list of capabilities that are supported by this client. |
170 """ |
170 """ |
171 protoparams = [] |
171 protoparams = set() |
172 comps = [e.wireprotosupport().name for e in |
172 comps = [e.wireprotosupport().name for e in |
173 util.compengines.supportedwireengines(util.CLIENTROLE)] |
173 util.compengines.supportedwireengines(util.CLIENTROLE)] |
174 protoparams.append('comp=%s' % ','.join(comps)) |
174 protoparams.add('comp=%s' % ','.join(comps)) |
175 return protoparams |
175 return protoparams |
176 |
176 |
177 def _performhandshake(ui, stdin, stdout, stderr): |
177 def _performhandshake(ui, stdin, stdout, stderr): |
178 def badresponse(): |
178 def badresponse(): |
179 # Flush any output on stderr. |
179 # Flush any output on stderr. |
624 |
624 |
625 # Finally, if supported by the server, notify it about our own |
625 # Finally, if supported by the server, notify it about our own |
626 # capabilities. |
626 # capabilities. |
627 if 'protocaps' in peer.capabilities(): |
627 if 'protocaps' in peer.capabilities(): |
628 try: |
628 try: |
629 peer._call("protocaps", caps=' '.join(_clientcapabilities())) |
629 peer._call("protocaps", |
|
630 caps=' '.join(sorted(_clientcapabilities()))) |
630 except IOError: |
631 except IOError: |
631 peer._cleanup() |
632 peer._cleanup() |
632 raise error.RepoError(_('capability exchange failed')) |
633 raise error.RepoError(_('capability exchange failed')) |
633 |
634 |
634 return peer |
635 return peer |