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
# test that we don't interrupt the merge session if
# a file-level merge failed
hg init repo
cd repo
echo foo > foo
echo a > bar
hg ci -Am 'add foo'
hg mv foo baz
echo b >> bar
echo quux > quux1
hg ci -Am 'mv foo baz'
hg up -qC 0
echo >> foo
echo c >> bar
echo quux > quux2
hg ci -Am 'change foo'
# test with the rename on the remote side
HGMERGE=false hg merge
hg resolve -l
# test with the rename on the local side
hg up -C 1
HGMERGE=false hg merge
echo % show unresolved
hg resolve -l
echo % unmark baz
hg resolve -u baz
echo % show
hg resolve -l
hg st
echo % re-resolve baz
hg resolve baz
echo % after
hg resolve -l
echo % resolve all warning
hg resolve
echo % resolve all
hg resolve -a
echo % after
hg resolve -l
true