Details
Details
- Reviewers
ryanmce - Group Reviewers
hg-reviewers - Commits
- rHG6be264009841: wireproto: use a proper exception instead of `assert False`
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
ryanmce |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
kwargs['bundlecaps'] = sorted(bundlecaps) | kwargs['bundlecaps'] = sorted(bundlecaps) | ||||
else: | else: | ||||
bundlecaps = () # kwargs could have it to None | bundlecaps = () # kwargs could have it to None | ||||
for key, value in kwargs.iteritems(): | for key, value in kwargs.iteritems(): | ||||
if value is None: | if value is None: | ||||
continue | continue | ||||
keytype = gboptsmap.get(key) | keytype = gboptsmap.get(key) | ||||
if keytype is None: | if keytype is None: | ||||
assert False, 'unexpected' | raise error.ProgrammingError( | ||||
'Unexpectedly None keytype for key %s' % key) | |||||
elif keytype == 'nodes': | elif keytype == 'nodes': | ||||
value = encodelist(value) | value = encodelist(value) | ||||
elif keytype in ('csv', 'scsv'): | elif keytype in ('csv', 'scsv'): | ||||
value = ','.join(value) | value = ','.join(value) | ||||
elif keytype == 'boolean': | elif keytype == 'boolean': | ||||
value = '%i' % bool(value) | value = '%i' % bool(value) | ||||
elif keytype != 'plain': | elif keytype != 'plain': | ||||
raise KeyError('unknown getbundle option type %s' | raise KeyError('unknown getbundle option type %s' |