From patchwork Fri Mar 28 22:40:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [20,of,22] wireproto: use decorator for the pushkey command From: Pierre-Yves David X-Patchwork-Id: 4140 Message-Id: To: mercurial-devel@selenic.com Cc: pierre-yves.david@ens-lyon.org Date: Fri, 28 Mar 2014 15:40:46 -0700 # HG changeset patch # User Pierre-Yves David # 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))) +@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'), })