Patchwork [18,of,22] wireproto: use decorator for the listkeys command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <c9488d24e618813255e5.1396046444@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4138/
State Accepted
Commit 0bb1882c85b03dffe5fc87de5db9585c8d83de3f
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 1396042941 25200
#      Fri Mar 28 14:42:21 2014 -0700
# Node ID c9488d24e618813255e59bb7c2c406ac23ce50d5
# Parent  887fd292243b336dd518a56656e2e556e311c083
wireproto: use decorator for the listkeys command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -619,10 +619,11 @@  def hello(repo, proto):
 
     capabilities: space separated list of tokens
     '''
     return "capabilities: %s\n" % (capabilities(repo, proto))
 
+@wireprotocommand('listkeys', 'namespace')
 def listkeys(repo, proto, namespace):
     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
@@ -791,11 +792,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'listkeys': (listkeys, 'namespace'),
     'lookup': (lookup, 'key'),
     'pushkey': (pushkey, 'namespace key old new'),
     'stream_out': (stream, ''),
     'unbundle': (unbundle, 'heads'),
 })