changeset 21655:35095f332846

bundle: introduce a listkey handler This makes it possible to handle listkeys-related data stored in a bundle2. There are no producers yet.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 27 May 2014 15:42:03 -0700
parents ddf9a00c1239
children 36200dc6b3bd
files mercurial/bundle2.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue May 27 15:29:08 2014 -0700
+++ b/mercurial/bundle2.py	Tue May 27 15:42:03 2014 -0700
@@ -146,6 +146,7 @@
 import struct
 import urllib
 import string
+import pushkey
 
 import changegroup, error
 from i18n import _
@@ -860,3 +861,10 @@
 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))