Patchwork [07,of,22] wireproto: use decorator for the between command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <e3e6a368d5b798f13022.1396046433@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4127/
State Accepted
Commit ae4bf69c8068436d23b1b56d205ca19b234e6c7b
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 1396042565 25200
#      Fri Mar 28 14:36:05 2014 -0700
# Node ID e3e6a368d5b798f13022aea6442b3fe9fcf4f304
# Parent  a88cf7b4766aa9054f94a9277fc7f29157c3ae4b
wireproto: use decorator for the between command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -511,10 +511,11 @@  def batch(repo, proto, cmds, others):
         if isinstance(result, ooberror):
             return result
         res.append(escapearg(result))
     return ';'.join(res)
 
+@wireprotocommand('between', 'pairs')
 def between(repo, proto, pairs):
     pairs = [decodelist(p, '-') for p in pairs.split(" ")]
     r = []
     for b in repo.between(pairs):
         r.append(encodelist(b) + "\n")
@@ -780,11 +781,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'between': (between, 'pairs'),
     'branchmap': (branchmap, ''),
     'branches': (branches, 'nodes'),
     'capabilities': (capabilities, ''),
     'changegroup': (changegroup, 'roots'),
     'changegroupsubset': (changegroupsubset, 'bases heads'),