A short reminder to myself. There is a small undocumented feature. It will try to linearize a changegroup by doing a deep first walk of revs and store them in that order. This creates long lines of revisions, in which each revision is stored after it’s parent. This assumes that changes are minimal between a child and a parent. To reorder an existing repository use:
$ hg --config bundle.reorder=True clone --pull repo.hg repo-reordered.hg
Note that you have to use –pull when you pull locally otherwise Mercurial will only use hardlinks or copy and don’t create changegroups for the wireprotocol.