--- a/mercurial/bundle2.py Sat Jun 06 00:50:27 2015 -0700
+++ b/mercurial/bundle2.py Wed Jun 10 13:10:53 2015 -0400
@@ -1109,7 +1109,8 @@
# These are only the static capabilities.
# Check the 'getrepocaps' function for the rest.
capabilities = {'HG20': (),
- 'error': ('abort', 'unsupportedcontent', 'pushraced'),
+ 'error': ('abort', 'unsupportedcontent', 'pushraced',
+ 'pushkey'),
'listkeys': (),
'pushkey': (),
'digests': tuple(sorted(util.DIGESTS.keys())),
@@ -1290,6 +1291,17 @@
"""Used to transmit abort error over the wire"""
raise util.Abort(inpart.params['message'], hint=inpart.params.get('hint'))
+@parthandler('error:pushkey', ('namespace', 'key', 'new', 'old', 'ret',
+ 'in-reply-to'))
+def handleerrorpushkey(op, inpart):
+ """Used to transmit failure of a mandatory pushkey over the wire"""
+ kwargs = {}
+ for name in ('namespace', 'key', 'new', 'old', 'ret'):
+ value = inpart.params.get(name)
+ if value is not None:
+ kwargs[name] = value
+ raise error.PushkeyFailed(inpart.params['in-reply-to'], **kwargs)
+
@parthandler('error:unsupportedcontent', ('parttype', 'params'))
def handleerrorunsupportedcontent(op, inpart):
"""Used to transmit unknown content error over the wire"""