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

Thomas Arendsen Hein thomas at intevation.de
Tue Feb 26 14:39:22 CST 2008


* Florent Guillaume <fg at nuxeo.com> [20080226 17:26]:
> Thomas Arendsen Hein wrote:
>  > [...] 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~~ =

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


I don't know a specific algorithm, but a rough description:
Below merges are separate branches, but at the merge and after that
it is a single branch again. Branches done halfway in between the
merge and the divert don't cause the merged branch to get a new
branch point

Maybe something like "ignore my own children and then use the heads
mechanism"?

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial-devel mailing list