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

Thomas Arendsen Hein thomas at intevation.de
Tue Feb 26 07:33:55 CST 2008


* 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:

First I built this repository:

    o  4~~ = 1
    |
  o |  3~~ = 2
  | |
  o |  2~~ = 2
  | |
  | o  1~~ = 1
  |/
  o    0~~ = unknown revision

So everything fine until here, though maybe 0~~ should simply return
0, because if you would merge in an unrelated repo, it would be the
branching point.

But then I merged the branches and for additional tests I committed
above that. Now everything between 0~~ and 6~~ yields revision 0,
but 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)

Maybe you have an idea about how the algorithm can be extended for
this? Of course only looking at the heads is no longer an option,
but the algorithm has to stop at merges that are the specified
revision's children or something like that.

Regards,
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