Patchwork [16,of,22] wireproto: use decorator for the hello command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <c827c7138b90afc234dd.1396046442@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4136/
State Accepted
Commit 5ad151f8a3fac40510fac2c4906d20046afc9295
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 1396042844 25200
#      Fri Mar 28 14:40:44 2014 -0700
# Node ID c827c7138b90afc234ddf56d318354d5bf0f30d6
# Parent  ddae81fd0a0eb8c0663eeb5e028cf45192cc076c
wireproto: use decorator for the hello command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -608,10 +608,11 @@  def getbundle(repo, proto, others):
 @wireprotocommand('heads')
 def heads(repo, proto):
     h = repo.heads()
     return encodelist(h) + "\n"
 
+@wireprotocommand('hello')
 def hello(repo, proto):
     '''the hello command returns a set of lines describing various
     interesting things about the server, in an RFC822-like format.
     Currently the only one defined is "capabilities", which
     consists of a line in the form:
@@ -789,11 +790,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'hello': (hello, ''),
     'known': (known, 'nodes *'),
     'listkeys': (listkeys, 'namespace'),
     'lookup': (lookup, 'key'),
     'pushkey': (pushkey, 'namespace key old new'),
     'stream_out': (stream, ''),