Patchwork [14,of,22] wireproto: use decorator for the getbundle command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <91e1b2de14e589d51e92.1396046440@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4134/
State Accepted
Commit 6aae815f3e0dccd12c672db5db7e927da16e3700
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 1396042807 25200
#      Fri Mar 28 14:40:07 2014 -0700
# Node ID 91e1b2de14e589d51e92b0f1407057afe23bace7
# Parent  dcf5b711f859509ec34f1484e25d4ab33de6d2ce
wireproto: use decorator for the getbundle command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -592,10 +592,11 @@  def changegroupsubset(repo, proto, bases
 def debugwireargs(repo, proto, one, two, others):
     # only accept optional args from the known set
     opts = options('debugwireargs', ['three', 'four'], others)
     return repo.debugwireargs(one, two, **opts)
 
+@wireprotocommand('getbundle', '*')
 def getbundle(repo, proto, others):
     opts = options('getbundle', ['heads', 'common', 'bundlecaps'], others)
     for k, v in opts.iteritems():
         if k in ('heads', 'common'):
             opts[k] = decodelist(v)
@@ -787,11 +788,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'getbundle': (getbundle, '*'),
     'heads': (heads, ''),
     'hello': (hello, ''),
     'known': (known, 'nodes *'),
     'listkeys': (listkeys, 'namespace'),
     'lookup': (lookup, 'key'),