D3170: wireproto: don't special case bundlecaps, but sort all scsv arguments
joerg.sonnenberger (Joerg Sonnenberger)
phabricator at mercurial-scm.org
Fri Apr 6 21:39:27 UTC 2018
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3170
AFFECTED FILES
mercurial/wireproto.py
CHANGE DETAILS
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -297,11 +297,7 @@
kwargs = pycompat.byteskwargs(kwargs)
self.requirecap('getbundle', _('look up remote changes'))
opts = {}
- bundlecaps = kwargs.get('bundlecaps')
- if bundlecaps is not None:
- kwargs['bundlecaps'] = sorted(bundlecaps)
- else:
- bundlecaps = () # kwargs could have it to None
+ bundlecaps = kwargs.get('bundlecaps') or set()
for key, value in kwargs.iteritems():
if value is None:
continue
@@ -311,8 +307,10 @@
'Unexpectedly None keytype for key %s' % key)
elif keytype == 'nodes':
value = encodelist(value)
- elif keytype in ('csv', 'scsv'):
+ elif keytype == 'csv':
value = ','.join(value)
+ elif keytype == 'scsv':
+ value = ','.join(sorted(value))
elif keytype == 'boolean':
value = '%i' % bool(value)
elif keytype != 'plain':
To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list