Differences between revisions 4 and 5
Revision 4 as of 2007-01-31 19:53:45
Size: 2087
Editor: BrendanCully
Comment: Flesh out partial history plan
Revision 5 as of 2007-03-07 02:15:02
Size: 2092
Editor: BrendanCully
Comment: Note that overlay can fork at any revision.
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
 * Allow fork to take a revision argument  * Allow fork to take a revision argument (./)

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. It could also be used as the basis for a partial history clone (eg a clone from revisions 1000-1500).

Mechanism:

  • Add a [repository] parent path in hgrc.
  • Create parent repo in localrepository init.
  • Pass along parent revlogs in revlog constructors (via repo.file, changelog() and manifest())
  • Create overlayindex and overlaymap types to unify the index and map of the revlog and its parent (shifting the offset and revision numbers in the local revlog according to the point it forked from the parent)
  • Add an OVERLAY flag to revlogng. When this flag is set, the base entry of the first revision in the revlog doubles as the fork point from the parent.
  • On commit, if no local revlog exists, find the base node of the parent in the parent repository. Copy from the base to the tip into the new revlog, with the offsets adjusted. Commit on top of that.

Deficiencies:

  • As soon as a commit happens, any new file revisions are forked to the new repo. This is because the overlay deliberately ignores revisions with linkrevs past the fork point, since it doesn't know whether the linkrev points to the same changeset. One (slow) possibility would be to match up the linkrevs in the filelog to their corresponding entries in the changelog.

Experimental patch queue: [http://hg.kublai.com/mercurial/patches/overlay/]

For partial history:

  • Allow fork to take a revision argument (./)

  • Have clone fork the changelog and manifest at that revision, and each file in that revision's manifest
  • pull up to desired revision
  • Allow overlay to instantiate when the parent is missing
  • gracefully handle missing revisions


CategoryNewFeatures

OverlayRepository (last edited 2012-10-25 20:54:21 by mpm)