This is an archive of the discontinued Mercurial Phabricator instance.

changegroup: fix to allow empty manifest parts
ClosedPublic

Authored by durham on Sep 6 2017, 9:39 PM.

Details

Summary

The current chunk reading algorithm relied on counting the number of empty
chunks and comparing it to the number of chunk lists it expected (1 list of
files for cg1 and cg2, and 1 list of files + 1 list of trees for cg3). This
implicitly assumed that both the changelog part and the manifestlog part were
never empty (since them being empty would cause it to count it as one list being
done, and screw up the count). In our treemanifest code, the manifest section
could be empty, so we need to handle that case.

This patches refactors that code to be more explicit about how it counts the
expected parts.

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

durham created this revision.Sep 6 2017, 9:39 PM
dsp accepted this revision.Sep 8 2017, 2:54 PM
This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.
mercurial/changegroup.py
225

I'll s/empty/noentries/ in flight.