Mercurial > hg
comparison mercurial/wireproto.py @ 34730:6be264009841
wireproto: use a proper exception instead of `assert False`
Differential Revision: https://phab.mercurial-scm.org/D1101
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 15 Oct 2017 00:06:06 -0400 |
parents | 6f532c1a4af0 |
children | 31fdd0509de9 |
comparison
equal
deleted
inserted
replaced
34729:6f532c1a4af0 | 34730:6be264009841 |
---|---|
323 for key, value in kwargs.iteritems(): | 323 for key, value in kwargs.iteritems(): |
324 if value is None: | 324 if value is None: |
325 continue | 325 continue |
326 keytype = gboptsmap.get(key) | 326 keytype = gboptsmap.get(key) |
327 if keytype is None: | 327 if keytype is None: |
328 assert False, 'unexpected' | 328 raise error.ProgrammingError( |
329 'Unexpectedly None keytype for key %s' % key) | |
329 elif keytype == 'nodes': | 330 elif keytype == 'nodes': |
330 value = encodelist(value) | 331 value = encodelist(value) |
331 elif keytype in ('csv', 'scsv'): | 332 elif keytype in ('csv', 'scsv'): |
332 value = ','.join(value) | 333 value = ','.join(value) |
333 elif keytype == 'boolean': | 334 elif keytype == 'boolean': |