Patchwork [17,of,22] wireproto: use decorator for the known command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <887fd292243b336dd518.1396046443@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4137/
State Accepted
Commit 0971939f51aa40f55bed5de139482b8d3eebf601
Headers show

Comments

Pierre-Yves David - March 28, 2014, 10:40 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1396042926 25200
#      Fri Mar 28 14:42:06 2014 -0700
# Node ID 887fd292243b336dd518a56656e2e556e311c083
# Parent  c827c7138b90afc234ddf56d318354d5bf0f30d6
wireproto: use decorator for the known command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -636,10 +636,11 @@  def lookup(repo, proto, key):
     except Exception, inst:
         r = str(inst)
         success = 0
     return "%s %s\n" % (success, r)
 
+@wireprotocommand('known', 'nodes *')
 def known(repo, proto, nodes, others):
     return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes)))
 
 def pushkey(repo, proto, namespace, key, old, new):
     # compatibility with pre-1.8 clients which were accidentally
@@ -790,11 +791,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'known': (known, 'nodes *'),
     'listkeys': (listkeys, 'namespace'),
     'lookup': (lookup, 'key'),
     'pushkey': (pushkey, 'namespace key old new'),
     'stream_out': (stream, ''),
     'unbundle': (unbundle, 'heads'),