[obsolet] base64 encore obsolete rel for pushkey
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 19 Sep 2011 18:27:30 +0200
changeset 89 757153438e58
parent 88 64fe5a4f877e
child 90 a5f6194eb05c
[obsolet] base64 encore obsolete rel for pushkey Yop this is ugly
hgext/obsolete.py
--- a/hgext/obsolete.py	Mon Sep 19 18:03:51 2011 +0200
+++ b/hgext/obsolete.py	Mon Sep 19 18:27:30 2011 +0200
@@ -80,6 +80,8 @@
 
 from mercurial.i18n import _
 
+import base64
+
 from mercurial import util
 from mercurial import context
 from mercurial import revset
@@ -221,7 +223,7 @@
     XXX this have be improved"""
     tmp = StringIO()
     _obsserialise(repo._obssubrels, tmp)
-    return {'relations': tmp.getvalue()}
+    return {'relations': base64.b64encode(tmp.getvalue())}
 
 pushkey.register('obsolete', pushobsolete, listobsolete)
 
@@ -405,7 +407,8 @@
             result = opull(remote, *args, **kwargs)
             if 'obsolete' in remote.listkeys('namespaces'):
                 tmp = StringIO()
-                tmp.write(remote.listkeys('obsolete')['relations'])
+                rels = remote.listkeys('obsolete')['relations']
+                tmp.write(base64.b64decode(rels))
                 tmp.seek(0)
                 obsrels = _obsdeserialise(tmp)
                 for sub, objs in obsrels.iteritems():