Patchwork [15,of,22] wireproto: use decorator for the heads command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <ddae81fd0a0eb8c0663e.1396046441@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4135/
State Accepted
Commit 31eacf182f80daba870d50684727167f20e998ec
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 1396042831 25200
#      Fri Mar 28 14:40:31 2014 -0700
# Node ID ddae81fd0a0eb8c0663eeb5e028cf45192cc076c
# Parent  91e1b2de14e589d51e92b0f1407057afe23bace7
wireproto: use decorator for the heads command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -603,10 +603,11 @@  def getbundle(repo, proto, others):
         elif k == 'bundlecaps':
             opts[k] = set(v.split(','))
     cg = repo.getbundle('serve', **opts)
     return streamres(proto.groupchunks(cg))
 
+@wireprotocommand('heads')
 def heads(repo, proto):
     h = repo.heads()
     return encodelist(h) + "\n"
 
 def hello(repo, proto):
@@ -788,11 +789,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'heads': (heads, ''),
     'hello': (hello, ''),
     'known': (known, 'nodes *'),
     'listkeys': (listkeys, 'namespace'),
     'lookup': (lookup, 'key'),
     'pushkey': (pushkey, 'namespace key old new'),