This is an archive of the discontinued Mercurial Phabricator instance.

changegroup: factor changelog chunk generation into own function
ClosedPublic

Authored by indygreg on Aug 6 2018, 3:51 PM.

Details

Summary

We have separate functions for generating manifests and filelogs.
Let's split changelog into its own function so things are consistent.

As part of this, we refactor the code slightly. Before, the
changelog linknode callback was updating state on variables
inherited via a closure. Since the closure is now separate from
generate(), we need to a way pass state between generate() and
_generatechangelog(). The return value of _generatechangelog()
is a 2-tuple where the first item is a dict containing accumulated
state. We then alias some of its members into the scope of
generate() to reduce code churn.

I will be converting other functions to a similar pattern in future
commits.

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

indygreg created this revision.Aug 6 2018, 3:51 PM
This revision was automatically updated to reflect the committed changes.