copies: extract data extraction into a revinfo function
The function is build once at the beginning of the algorithm and used fetch
appropriate information for each revision.
This abstracts some implementation details from the main algorithm and will help
us to access the data more efficiently in future changesets.
Differential Revision: https://phab.mercurial-scm.org/D7070