[PATCH 19 of 22] wireproto: use decorator for the lookup command

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


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

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -626,10 +626,11 @@ 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
 
+ at wireprotocommand('lookup', 'key')
 def lookup(repo, proto, key):
     try:
         k = encoding.tolocal(key)
         c = repo[k]
         r = c.hex()
@@ -792,10 +793,9 @@ def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'lookup': (lookup, 'key'),
     'pushkey': (pushkey, 'namespace key old new'),
     'stream_out': (stream, ''),
     'unbundle': (unbundle, 'heads'),
 })


More information about the Mercurial-devel mailing list