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.
#
# Avoid interference from actual test env:
unset HGTEST_JOBS
unset HGTEST_TIMEOUT
unset HGTEST_PORT
unset HGTEST_SHELL