snapshot: extract parent chain computation
The final step of this series is to include chain related to "prev" in the
search. Before adding that code we do some simple code movement to clarify the
next diff.
#require docutils gettext $ $TESTDIR/check-gendoc el checking for parse errors