revlogv2: add a get_data helper to grab the next piece of docket
This make the processing more compact but abstracting repetitive processing away.
Differential Revision: https://phab.mercurial-scm.org/D10774