reviewboard: handle kwargs more robustly in `commit` (
bug 1243161); r=gps
--- a/hgext/reviewboard/client.py
+++ b/hgext/reviewboard/client.py
@@ -1048,17 +1048,17 @@ def reposetup(ui, repo):
"""
# Some callers of commit() may not pass named arguments. Slurp
# extra from positional arguments.
if len(args) == 7:
assert 'extra' not in kwargs
kwargs['extra'] = args[6]
args = tuple(args[0:6])
- if not kwargs['extra']:
+ if 'extra' not in kwargs or not kwargs['extra']:
kwargs['extra'] = {}
if 'commitid' not in kwargs['extra'] and self.reviews.remoteurl:
kwargs['extra']['commitid'] = genid(self)
return super(reviewboardrepo, self).commit(*args, **kwargs)
repo.__class__ = reviewboardrepo