# HG changeset patch # User Pierre-Yves David # Date 2014-05-27 22:42:03 # Node ID 35095f3328465ae586866933b30b4fb905500615 # Parent ddf9a00c1239499eb5ace1170be497d01c76e30b bundle: introduce a listkey handler This makes it possible to handle listkeys-related data stored in a bundle2. There are no producers yet. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -146,6 +146,7 @@ import util import struct import urllib import string +import pushkey import changegroup, error from i18n import _ @@ -860,3 +861,10 @@ def handlereplycaps(op, inpart): def handlereplycaps(op, inpart): """Used to transmit push race error over the wire""" raise error.ResponseError(_('push failed:'), inpart.params['message']) + +@parthandler('b2x:listkeys', ('namespace',)) +def handlelistkeys(op, inpart): + """retrieve pushkey namespace content stored in a bundle2""" + namespace = inpart.params['namespace'] + r = pushkey.decodekeys(inpart.read()) + op.records.add('listkeys', (namespace, r))