[PATCH] branchingrev: find the start of the branch containing a node

Florent Guillaume fg at nuxeo.com
Tue Feb 26 10:22:16 CST 2008


Thomas Arendsen Hein wrote:
> * Florent Guillaume <fg at nuxeo.com> [20080226 01:19]:
>> # HG changeset patch
>> # User Florent Guillaume <fg at nuxeo.com>
>> # Date 1203984621 -3600
>> # Node ID 689ecf3985b1c4a6dd2321dd9f30489f0d66105e
>> # Parent  50a277e6ceaeaa5f890cacc9dcab745a4387dd58
>> branchingrev: find the start of the branch containing a node
>>
>> Adding a branchingrev method on the revlog (finds the oldest revision
>> that has the same single head as a given revision).
>>
>> Adding a foo~~ syntax for parentrevspec to return that.
> 
> This already looks very good and I'm tempted to push it despite the
> problem (or feature request?) I just found:

Thanks.

 > [...] I think it should yield:
> 
>   o    6~~ = 0
>   |
>   o    5~~ = 0
>   |\
>   | o  4~~ = 1
>   | |
>   o |  3~~ = 2
>   | |
>   o |  2~~ = 2
>   | |
>   | o  1~~ = 1
>   |/
>   o    0~~ = 0
> 
> (or "unknown revision" instead of 0, but I think 0 is better)

That would be quite a different algorithm than just relying on heads. So 
do you just want to crawl up to the first branching point? What would 
you want for the following case:

    o   5~~ =
    |
    o   4~~ =
   /|
  o |   3~~ =
  | |
  | | o 2~~ =
  | |/
  | o   1~~ =
  |/
  o     0~~ =

Florent

-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87


More information about the Mercurial-devel mailing list