Help with extension writing

Dirkjan Ochtman dirkjan at ochtman.nl
Thu Apr 15 01:32:58 CDT 2010


On Thu, Apr 15, 2010 at 03:28, Greg Ward <greg-hg at gerg.ca> wrote:
>> One last question: Sometimes when a file has 2 parents, we may want to find
>> the closest changectx mergepoint for the 2 ancestor revisions (I guess there
>> could be more than one, but there would be 1 that is closer or as close as
>> the others) - like changectx.ancestor(self, c2), but for descendants - there
>> doesn't appear to be one on changectx, is there something like this
>> elsewhere?
>
> Doesn't the linkrev of the parent file revs give what you want?  If
> memory serves, filectx.parents() returns 1 or 2 other filectxs, each
> of which has a linkrev().  I believe linkrev() is a revnum in the
> changelog.  I think that is as close as you're going to get.  If not,
> can you show us a cooked example where that doesn't work?

It sounds like he's trying to get the common descendant for two
divergent filerevs.

I don't know about any API we have for that, but maybe someone else
(Benoit) does?

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list