fixup! Rewrite update algorithm to be restartable and extensible.

Better support for working in hg trees.