Patchwork [10,of,22] wireproto: use decorator for the capabilities command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <d7736d49a67b8c8d2fe9.1396046436@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4130/
State Accepted
Commit 1bb8ed6c000cc5f07cbded303eb9bfef84b72af9
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 1396042648 25200
#      Fri Mar 28 14:37:28 2014 -0700
# Node ID d7736d49a67b8c8d2fe91e5930f17befc76742c1
# Parent  a4903974ce75aba70c5ccda9515aa317229c9348
wireproto: use decorator for the capabilities command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -569,10 +569,11 @@  def _capabilities(repo, proto):
     caps.append('httpheader=1024')
     return caps
 
 # If you are writting and extension and consider wrapping this function. Wrap
 # `_capabilities` instead.
+@wireprotocommand('capabilities')
 def capabilities(repo, proto):
     return ' '.join(_capabilities(repo, proto))
 
 def changegroup(repo, proto, roots):
     nodes = decodelist(roots)
@@ -783,11 +784,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'capabilities': (capabilities, ''),
     'changegroup': (changegroup, 'roots'),
     'changegroupsubset': (changegroupsubset, 'bases heads'),
     'debugwireargs': (debugwireargs, 'one two *'),
     'getbundle': (getbundle, '*'),
     'heads': (heads, ''),