This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: allow direct stream processing for unbundle
ClosedPublic

Authored by joerg.sonnenberger on Feb 26 2018, 8:38 PM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lothiraldan added inline comments.
mercurial/wireproto.py
1090

It's not perfectly clear why do we need to do this loop? Is it to consume the end of the payload before ending? Would it be possible to add a comment here?

joerg.sonnenberger updated this revision to Diff 6178.
lothiraldan accepted this revision.Feb 28 2018, 4:01 AM
indygreg accepted this revision.Apr 6 2018, 7:07 PM
indygreg added a subscriber: indygreg.

LGTM. Thanks for the feature!

This revision is now accepted and ready to land.Apr 6 2018, 7:07 PM
This revision was automatically updated to reflect the committed changes.