wireproto: do not call pushkey module directly (issue3041)
authorAndreas Freimuth <andreas.freimuth@united-bits.de>
Mon, 10 Oct 2011 13:52:54 +0200
changeset 15217 42d0d4f63bf0
parent 15216 7678790279da
child 15218 c81dce8a7bb6
wireproto: do not call pushkey module directly (issue3041) Call the repos pushkey/listkeys member function instead. So the pushkey-hooks are triggered.
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Mon Oct 10 17:34:17 2011 +0200
+++ b/mercurial/wireproto.py	Mon Oct 10 13:52:54 2011 +0200
@@ -10,7 +10,6 @@
 from node import bin, hex
 import changegroup as changegroupmod
 import repo, error, encoding, util, store
-import pushkey as pushkeymod
 
 # abstract batching support
 
@@ -461,7 +460,7 @@
     return "capabilities: %s\n" % (capabilities(repo, proto))
 
 def listkeys(repo, proto, namespace):
-    d = pushkeymod.list(repo, encoding.tolocal(namespace)).items()
+    d = repo.listkeys(encoding.tolocal(namespace)).items()
     t = '\n'.join(['%s\t%s' % (encoding.fromlocal(k), encoding.fromlocal(v))
                    for k, v in d])
     return t
@@ -491,9 +490,8 @@
     else:
         new = encoding.tolocal(new) # normal path
 
-    r = pushkeymod.push(repo,
-                        encoding.tolocal(namespace), encoding.tolocal(key),
-                        encoding.tolocal(old), new)
+    r = repo.pushkey(encoding.tolocal(namespace), encoding.tolocal(key),
+                     encoding.tolocal(old), new)
     return '%s\n' % int(r)
 
 def _allowstream(ui):