# HG changeset patch # User Pierre-Yves David # Date 2014-05-23 00:20:52 # Node ID 12cd3827b86009fb0c3efd163926b9efd8dedecb # Parent 4953cd193e84f9d1465e3017b390aef68228d95a wireproto: add a ``boolean`` type for getbundle parameters This will be used to control inclusion of some parts in a bundle2. diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -349,6 +349,8 @@ class wirepeer(peer.peerrepository): value = encodelist(value) elif keytype == 'csv': value = ','.join(value) + elif keytype == 'boolean': + value = bool(value) elif keytype != 'plain': raise KeyError('unknown getbundle option type %s' % keytype) @@ -652,6 +654,8 @@ def getbundle(repo, proto, others): opts[k] = decodelist(v) elif keytype == 'csv': opts[k] = set(v.split(',')) + elif keytype == 'boolean': + opts[k] = '%i' % bool(v) elif keytype != 'plain': raise KeyError('unknown getbundle option type %s' % keytype)