stablerange: rearrange the reusing logic to prepare to merge
We'll soon be able to reuse some lower range when dealing with merge too. So we
prepare the code for this in advance for clarity.
doc generated with sphinx. tutorial exported using sphinxedhghttp://hg.piranha.org.ua/sphinxedhg/