Patchwork [11,of,22] wireproto: use decorator for the changegroup command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <50f44cb30163f10a9c44.1396046437@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4131/
State Accepted
Commit 96ecb77f971d5d5728b11ba66a03376cf814d911
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 1396042699 25200
#      Fri Mar 28 14:38:19 2014 -0700
# Node ID 50f44cb30163f10a9c44254cead1a70152d7d77a
# Parent  d7736d49a67b8c8d2fe91e5930f17befc76742c1
wireproto: use decorator for the changegroup command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -573,10 +573,11 @@  def _capabilities(repo, proto):
 # `_capabilities` instead.
 @wireprotocommand('capabilities')
 def capabilities(repo, proto):
     return ' '.join(_capabilities(repo, proto))
 
+@wireprotocommand('changegroup', 'roots')
 def changegroup(repo, proto, roots):
     nodes = decodelist(roots)
     cg = repo.changegroup(nodes, 'serve')
     return streamres(proto.groupchunks(cg))
 
@@ -784,11 +785,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'changegroup': (changegroup, 'roots'),
     'changegroupsubset': (changegroupsubset, 'bases heads'),
     'debugwireargs': (debugwireargs, 'one two *'),
     'getbundle': (getbundle, '*'),
     'heads': (heads, ''),
     'hello': (hello, ''),