Patchwork [08,of,22] wireproto: use decorator for the branchmap command

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <f4f4fc520af9c442da14.1396046434@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4128/
State Accepted
Commit c8b9cbf558408be9addad52a7a2139b7761d4d1b
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 1396042601 25200
#      Fri Mar 28 14:36:41 2014 -0700
# Node ID f4f4fc520af9c442da14ec0caa6ee83dba44e2c8
# Parent  e3e6a368d5b798f13022aea6442b3fe9fcf4f304
wireproto: use decorator for the branchmap command

Patch

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