comparison mercurial/wireprototypes.py @ 37414:2d965bfeb8f6

wireproto: allow direct stream processing for unbundle Introduce a new option server.streamunbundle which starts a transaction immediately to apply a bundle instead of writing it to a temporary file first. This side steps the need for a large tmp directory at the cost of preventing concurrent pushes. This is a reasonable trade-off for many setups as concurrent pushes for the main branch at least are disallowed anyway. The option defaults to off to preserve existing behavior. Change the wireproto interface to provide a generator for reading the payload and make callers responsible for consuming all data. Differential Revision: https://phab.mercurial-scm.org/D2470
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 27 Feb 2018 02:37:31 +0100
parents afcfdf53e4b5
children 0b7475ea38cf
comparison
equal deleted inserted replaced
37413:33af46d639b4 37414:2d965bfeb8f6
121 """Returns the list of protocol-level capabilities of client 121 """Returns the list of protocol-level capabilities of client
122 122
123 Returns a list of capabilities as declared by the client for 123 Returns a list of capabilities as declared by the client for
124 the current request (or connection for stateful protocol handlers).""" 124 the current request (or connection for stateful protocol handlers)."""
125 125
126 def forwardpayload(fp): 126 def getpayload():
127 """Read the raw payload and forward to a file. 127 """Provide a generator for the raw payload.
128 128
129 The payload is read in full before the function returns. 129 The caller is responsible for ensuring that the full payload is
130 processed.
130 """ 131 """
131 132
132 def mayberedirectstdio(): 133 def mayberedirectstdio():
133 """Context manager to possibly redirect stdio. 134 """Context manager to possibly redirect stdio.
134 135