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

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <92e7f3f11c116bc33a93.1396046447@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4141/
State Accepted
Commit 588e24f3eea37b05c1aa78325a65fdd3b068f828
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 1396042991 25200
#      Fri Mar 28 14:43:11 2014 -0700
# Node ID 92e7f3f11c116bc33a93541e491248c91b923e7a
# Parent  d58ada30d934b5a5ca155ffb06d377771e047e95
wireproto: use decorator for the stream command

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -681,10 +681,11 @@  def _allowstream(ui):
 
 def _walkstreamfiles(repo):
     # this is it's own function so extensions can override it
     return repo.store.walk()
 
+@wireprotocommand('stream_out')
 def stream(repo, proto):
     '''If the server supports streaming clone, it advertises the "stream"
     capability with a value representing the version and flags of the repo
     it is serving. Client checks to see if it understands the format.
 
@@ -794,8 +795,7 @@  def unbundle(repo, proto, heads):
     finally:
         fp.close()
         os.unlink(tempname)
 
 commands.update({
-    'stream_out': (stream, ''),
     'unbundle': (unbundle, 'heads'),
 })