mercurial/sshrepo.py
changeset 11369 02a4373ca5cd
parent 11366 1765897fc497
child 11586 ddaaaa23bb8f
--- a/mercurial/sshrepo.py	Wed Jun 16 16:04:46 2010 -0500
+++ b/mercurial/sshrepo.py	Wed Jun 16 16:05:13 2010 -0500
@@ -273,4 +273,21 @@
     def stream_out(self):
         return self.do_cmd('stream_out')
 
+    def pushkey(self, namespace, key, old, new):
+        if not self.capable('pushkey'):
+            return False
+        d = self.call("pushkey",
+                      namespace=namespace, key=key, old=old, new=new)
+        return bool(int(d))
+
+    def listkeys(self, namespace):
+        if not self.capable('pushkey'):
+            return {}
+        d = self.call("listkeys", namespace=namespace)
+        r = {}
+        for l in d.splitlines():
+            k, v = l.split('\t')
+            r[k.decode('string-escape')] = v.decode('string-escape')
+        return r
+
 instance = sshrepository