From c4d12e35a5a154d95e46805ab9c9c430559208e7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves David Date: Tue, 27 May 2014 15:42:03 -0700 Subject: [PATCH] bundle: introduce a listkey handler This makes it possible to handle listkeys-related data stored in a bundle2. There are no producers yet. --- mercurial/bundle2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py index 4206d19daa..5d9108e25c 100644 --- 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))