RFC: Updated plan for adding shallow clones to Mercurial (partial history)

Matt Mackall mpm at selenic.com
Wed Apr 1 14:23:52 CDT 2009


On Wed, 2009-04-01 at 14:40 +0200, Peter Arrenbrecht wrote:
> Hi all
> 
> I have uploaded a new, much updated plan for adding shallow clones to Mercurial:
> 
>   http://www.selenic.com/mercurial/wiki/index.cgi/ShallowClone
> 
> Feedback is very welcome.
> 
> The plan is the product of quite a bit of prototyping which tells me
> the basic ideas should be fairly sound. The last prototype which
> already works to a large degree over the wire is at
> http://bitbucket.org/parren/hg-shallow/. It differs markedly from the
> proposed plan in how unwanted changesets are negotiated, though.
> 
> Matt, can you imagine something like this plan being accepted into Hg
> at some point? We might get a student tackling it in the current
> Summer of Code.

My intuition is that this is more complicated than necessary.

In particular, there's a fair amount of trickery here with trimming and
hiding various dangling links outside of the wanted history. If instead,
you were to keep full revlog indexes around, you wouldn't have this
problem. You would be able to trivially identify precisely what was a
dangling (but otherwise valid) link and what was a corrupt link.

I'm also a little concerned by things like dangling merges looking like
linear changesets and having only one root. The restrictions on push are
a little confusing.

Some silly ideas: what if we introduced a new pseudo-changeset named
"prehistory" that all dangling links could point to? 

What if we keep a complete index for just the changelog? This solves
most of the linkrev and merge pointer issues.

What if we add something like 'archive' to the wire protocol so that a
client can make a 'synthetic' repo up to a given rev from a flat set of
files, then do a normal pull on top of it?

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list