revlog: refactor logic to compute nodemap file in separate function
I will like to use it one more place.
Differential Revision: https://phab.mercurial-scm.org/D9933
To run the tests, do:cd tests/python run-tests.pySee https://mercurial-scm.org/wiki/WritingTests formore information on writing tests.