Patchwork [12,of,22] wireproto: use decorator for the changegroupsubset command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <0d9f6635d9ee9915ee58.1396046438@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4132/
State Accepted
Commit fc7219ec08bb608b912780bba190a74805778dd7
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 1396042720 25200
#      Fri Mar 28 14:38:40 2014 -0700
# Node ID 0d9f6635d9ee9915ee588a15587bf5739e19d150
# Parent  50f44cb30163f10a9c44254cead1a70152d7d77a
wireproto: use decorator for the changegroupsubset command

Patch

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