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

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Fri Mar 28 17:40:48 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at 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

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))
 
+ at 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'),
-})


More information about the Mercurial-devel mailing list