[PATCH 00 of 12] RFC: Overlay repositories

Alexis S. L. Carvalho alexis at cecm.usp.br
Tue Jan 9 16:13:07 CST 2007


Thus spake Brendan Cully:
> On Wednesday, 03 January 2007 at 20:17, Alexis S. L. Carvalho wrote:
> > You probably want to hide/ignore revisions in a parent revlog if their
> > linkrev is larger than the changelog offset, otherwise at least hg pull
> > and hg log <filename> may be fooled[1].
> 
> hmm, I'm not sure what the best way to approach this is. I could pass
> along the changelog startrev in repo.manifest and repo.file, but that
> would mean instantiating the changelog for any repository revlog
> operation. We probably do this in practice anyway, but I don't really
> like the dependency. Or I could simply paper over this in log. What's
> the issue with pull?

localrepo.changegroup will first create the set of all changelog
revisions that it has to send and the list of files touched by these
revisions.  It then scans the filelogs looking at the linkrevs to find
out what file revisions it has to send.  It may end up sending more file
revisions than it should.[1]

log and pull are just the two cases that I remembered quickly - you'd
probably have to audit every use of linkrev to see if it's safe if you
decide to paper over it...

Alexis

[1] - example:
hg init a
cd a
echo foo > foo
hg add foo
hg ci -m 'add foo'
hg clone --overlay . ../overlay
echo >> foo
hg ci -m 'change foo'
cd ../overlay
echo bar > bar
hg add bar
hg ci -m 'add bar'
cd ..
hg clone --pull overlay clone   #note that clone is a regular repo
cd clone
hg verify

checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
foo:89d98a7032b6 points to unexpected changeset 1
2 files, 2 changesets, 3 total revisions
1 integrity errors encountered!


More information about the Mercurial-devel mailing list