Patchwork [06,of,22] wireproto: use decorator for the batch command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <a88cf7b4766aa9054f94.1396046432@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4126/
State Accepted
Commit aedec880e09542aae23ff7a5718a461efbd46c46
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 1396042536 25200
#      Fri Mar 28 14:35:36 2014 -0700
# Node ID a88cf7b4766aa9054f94a9277fc7f29157c3ae4b
# Parent  b543d97beb42db45c2952031a87e6c4f75f2b820
wireproto: use decorator for the batch command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -479,10 +479,11 @@  def wireprotocommand(name, args=''):
     def register(func):
         commands[name] = (func, args)
         return func
     return register
 
+@wireprotocommand('batch', 'cmds *')
 def batch(repo, proto, cmds, others):
     repo = repo.filtered("served")
     res = []
     for pair in cmds.split(';'):
         op, args = pair.split(' ', 1)
@@ -779,11 +780,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'batch': (batch, 'cmds *'),
     'between': (between, 'pairs'),
     'branchmap': (branchmap, ''),
     'branches': (branches, 'nodes'),
     'capabilities': (capabilities, ''),
     'changegroup': (changegroup, 'roots'),