Page MenuHomePhabricator

treemanifest: fix historypack corruption bug
ClosedPublic

Authored by durham on Jul 18 2017, 9:35 AM.

Details

Reviewers
mitrandir
Group Reviewers
Restricted Project
Commits
rFBHGX787cd2a2b239: treemanifest: fix historypack corruption bug
Summary

The history pack writer had a bug where if the same node was added to the
mutablehistorypack N times, it would write out that it had N entries, but then
it would only write a single entry. This caused corruption (the length value
didn't match the actual number of entries) that broke repack.

This primarily affected users who used the old version of treemanifest (where
trees were converted on the client side). The new version of treemanifest only
seems to repro this in rare cases, like when rebasing multiple commits that
create the same trees.

Test Plan

Added a test. It failed before and passes after.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
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.Jul 18 2017, 9:35 AM
mitrandir accepted this revision.Jul 18 2017, 10:34 AM
This revision is now accepted and ready to land.Jul 18 2017, 10:34 AM

Wow, we already have 128 revs in this phabricator, time to party!

This revision was automatically updated to reflect the committed changes.