Interested in working on Partial Cloning

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Thu Mar 26 02:04:19 CDT 2009


On Tue, Mar 24, 2009 at 10:19 AM, Madhusudan C.S <madhusudancs at gmail.com> wrote:
>> As I said above, not _the_ ancestor, but _a_ common ancestor that is
>> nearer. Can you imagine and sketch such a scenario? (Try one with more
>> than one common ancestor first. Then one where a shallow clone rooted
>> at a particular node would be missing the nearer one. This should give
>> you a good introduction to thinking about these DAGs. Sketching these
>> in ASCII art is a bit of a pain, so you might want to just sketch by
>> hand, then create the situation in a temp repo and use `hg glog` to
>> have it ASCII-graphed for you.)
>>
> I made an attempt to imagine the scenario you mentioned.
> Please tell me if I am right or correct me if I am wrong.
> (Hopefully studying 1 full semester of Graph Theory will
> come to my rescue ;-) )
>
> Scenario with multiple common ancestors
>        d - e
>       /
>   b - c
>  /     \
> a       f - g
>  \     /
>   h - i - j - k
>
> In this scenario e and g AFAI have understood have more
> than one common ancestors, them being a and c. We can
> also say e g and k have multiple common ancestors. Am
> I right?

Yes, but. Since a is also an ancestor of c, I would think a merge
would always choose c as the merge base. And there is no way you can
shallow clone to get e, g, and a, but not c. Can you find a scenario
where neither of the two common ancestors is an ancestor of the other?
Can you figure out what rules Mercurial uses to choose one over the
other when merging (by looking into the code)? Can we shallow clone
such that the one Mercurial would normally choose is not present?

-parren



More information about the Mercurial-devel mailing list