[PATCH 20 of 22] wireproto: use decorator for the pushkey command

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Fri Mar 28 17:40:46 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1396042975 25200
#      Fri Mar 28 14:42:55 2014 -0700
# Node ID d58ada30d934b5a5ca155ffb06d377771e047e95
# Parent  db8c9286ba8d7be9a91df430ea0bf8318c2c5385
wireproto: use decorator for the pushkey command

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -642,10 +642,11 @@ def lookup(repo, proto, key):
 
 @wireprotocommand('known', 'nodes *')
 def known(repo, proto, nodes, others):
     return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes)))
 
+ at 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
     if len(new) == 20 and new.encode('string-escape') != new:
         # looks like it could be a binary node
@@ -793,9 +794,8 @@ def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'pushkey': (pushkey, 'namespace key old new'),
     'stream_out': (stream, ''),
     'unbundle': (unbundle, 'heads'),
 })


More information about the Mercurial-devel mailing list