Overlay Repositories
Hard links are deficient or unavailable on some file systems, so it'd be nice to be able to do cheap branching without them. One way would be to support overlay repositories, in which another repository is consulted if a revision isn't available locally. This could possibly also be used for a form of history rewriting where missing revisions are synthesized according to a policy.
Vague plan:
- Add a [repository] parent path in hgrc.
- If a revlog is entirely missing, consult the parent repo.
- If a revlog is present and has the PARTIAL flag set, the first index entry describes the offset from the parent revlog at which the current revlog starts, as well as the last node and revision in the parent. Other index fields are set to 0.
- On commit, if no local revlog exists, find the base node of the parent in the parent repository. Set up the local revlog including everything from that point on.