Patchwork [09,of,22] wireproto: use decorator for the branches command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <a4903974ce75aba70c5c.1396046435@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4129/
State Accepted
Commit acbfce12fafd9ed7148d3c0f504a33d405750563
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 1396042622 25200
#      Fri Mar 28 14:37:02 2014 -0700
# Node ID a4903974ce75aba70c5ccda9515aa317229c9348
# Parent  f4f4fc520af9c442da14ec0caa6ee83dba44e2c8
wireproto: use decorator for the branches command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -529,10 +529,11 @@  def branchmap(repo, proto):
         branchname = urllib.quote(encoding.fromlocal(branch))
         branchnodes = encodelist(nodes)
         heads.append('%s %s' % (branchname, branchnodes))
     return '\n'.join(heads)
 
+@wireprotocommand('branches', 'nodes')
 def branches(repo, proto, nodes):
     nodes = decodelist(nodes)
     r = []
     for b in repo.branches(nodes):
         r.append(encodelist(b) + "\n")
@@ -782,11 +783,10 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'branches': (branches, 'nodes'),
     'capabilities': (capabilities, ''),
     'changegroup': (changegroup, 'roots'),
     'changegroupsubset': (changegroupsubset, 'bases heads'),
     'debugwireargs': (debugwireargs, 'one two *'),
     'getbundle': (getbundle, '*'),