phases: reduce code duplication in phasecache.getrevset
This is a functional NOP other than reducing some of the duplication
in that method.
Differential Revision: https://phab.mercurial-scm.org/D7853
To run the tests, do:cd tests/python run-tests.pySee https://mercurial-scm.org/wiki/WritingTests formore information on writing tests.