[PATCH] wireproto: do not call pushkey module directly (issue3041)

Andreas Freimuth andreas.freimuth at united-bits.de
Mon Oct 10 07:36:32 CDT 2011


# HG changeset patch
# User Andreas Freimuth <andreas.freimuth at united-bits.de>
# Date 1318247574 -7200
# Node ID 7d94324145f3be60e794e176d355d6830544fb04
# Parent  231aac5280baae0614d7f278bb306b95c4a1488b
wireproto: do not call pushkey module directly (issue3041)

Call the repos pushkey/listkeys member function instead.
So the pushkey-hooks are triggered.

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -10,7 +10,6 @@ from i18n import _
 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 @@ def hello(repo, proto):
     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 @@ def pushkey(repo, proto, namespace, key,
     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):


More information about the Mercurial-devel mailing list