commit: look-up new revision once
Look-up by node is slightly more expensive, so since it is necessary
more than once, do it explicitly.
Differential Revision: https://phab.mercurial-scm.org/D9830
To run the tests, do:
cd tests/
python run-tests.py
See https://mercurial-scm.org/wiki/WritingTests for
more information on writing tests.