evolve: extract cleanup logic in the evolve function
We are going to need to reuse the cleanup logic when introducing --rev, so
we extract it in a method to avoid code duplication.
doc generated with sphinx. tutorial exported using sphinxedhghttp://hg.piranha.org.ua/sphinxedhg/