shrink-revlog: add "reverse postorder" and "postorder reverse" toposorts.
Based on a patch by Benoit Boissinot, adapted to the pluggable sort
algorithm design. toposort_reversepostorder() is a very good
performer; it's designed to recreate what the revlog would have looked
like if Mercurial had parent deltas now. toposort_postorderreverse()
is unstable and very inconsistent, but perhaps with some work it could
be made better.
#!/bin/sh
hg init repo
cd repo
touch foo
hg ci -Am 'add foo'
hg up -C null
# this should be stored as a delta against rev 0
echo foo bar baz > foo
hg ci -Am 'add foo again'
hg debugindex .hg/store/data/foo.i