index: add a `rev` method (API)
The new `index.rev(node)` is to be preferred over using `node
index.nodemap[node]`.
This get us closer to be able to remove the `nodemap` attribute of the index.
Differential Revision: https://phab.mercurial-scm.org/D7324