This is an archive of the discontinued Mercurial Phabricator instance.

cmdutil: refactor I/O for exporting
AbandonedPublic

Authored by indygreg on Apr 6 2018, 6:10 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

Using generators for feeding chunks into I/O is more flexible than
passing a file object or write function around.

This commit refactors the patch exporting code to emit a series a data
chunks instead of doing push-based I/O. As a side-effect, we could now
obtain the patch representation of a changeset without having to use
a file object. Yay!

Code around the management of the file handles has also been cleaned up
a bit.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped