wireproto: use decorator for the pushkey command
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 28 Mar 2014 14:42:55 -0700
changeset 20921 70ed3174ce69
parent 20920 7fac25eddcea
child 20922 588e24f3eea3
wireproto: use decorator for the pushkey command
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Fri Mar 28 14:42:38 2014 -0700
+++ b/mercurial/wireproto.py	Fri Mar 28 14:42:55 2014 -0700
@@ -644,6 +644,7 @@
 def known(repo, proto, nodes, others):
     return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes)))
 
+@wireprotocommand('pushkey', 'namespace key old new')
 def pushkey(repo, proto, namespace, key, old, new):
     # compatibility with pre-1.8 clients which were accidentally
     # sending raw binary nodes rather than utf-8-encoded hex
@@ -795,7 +796,6 @@
         os.unlink(tempname)
 
 commands.update({
-    'pushkey': (pushkey, 'namespace key old new'),
     'stream_out': (stream, ''),
     'unbundle': (unbundle, 'heads'),
 })