As discussed during the sprint. See the doc comment and doctests for specification and examples. This is used in subsequent patches to export revlog and changelog DAGs, and to generate a repo with a given changelog DAG.