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

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <35e05ae08df44b355bbc.1396046448@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4142/
State Accepted
Commit d771641b705127218044ea858c809ff12753171e
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 1396043010 25200
#      Fri Mar 28 14:43:30 2014 -0700
# Node ID 35e05ae08df44b355bbcb72f584d15ef62d097e5
# Parent  92e7f3f11c116bc33a93541e491248c91b923e7a
wireproto: use decorator for the ubundle command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -748,10 +748,11 @@  def stream(repo, proto):
             raise
         sopener.mustaudit = oldaudit
 
     return streamres(streamer(repo, entries, total_bytes))
 
+@wireprotocommand('unbundle', 'heads')
 def unbundle(repo, proto, heads):
     their_heads = decodelist(heads)
 
     def check_heads():
         heads = repo.heads()
@@ -793,9 +794,5 @@  def unbundle(repo, proto, heads):
         return pushres(r)
 
     finally:
         fp.close()
         os.unlink(tempname)
-
-commands.update({
-    'unbundle': (unbundle, 'heads'),
-})