[MERGE] [BUG #172970] bzrlib.revision.is_ancestor should use graph functions.

John Arbash Meinel john at arbash-meinel.com
Fri Nov 30 03:39:15 GMT 2007


The attached patch helps make merge a bit faster. It was using
get_ancestry() (as part of an is_ancestor() check).

And with knits, get_ancestry() isn't terribly expensive, because the
information was cached in an easy-to-get-to way.

With packs, this has become much slower, though it should be faster when
you only need to access part of the ancestry.

This patch changes bzrlib.revision.is_ancestor() to use the graph version
of the same function.

I originally thought to deprecate is_ancestor() entirely, but it shortcuts
the NULL_REVISION check. graph.is_ancestor() does answer correctly in
those cases, but it has the downside of taking forever to do so (because
it has to walk the complete ancestry until it gets there.)

I don't know if it is really worth the short-cut, but it was there, so I'm
leaving it in. (If it is really worth it, we probably should move it into
Graph.is_ancestor(), since it is a really cheap check.)

But this at least improves things, and does so with a minimal amount of
effort on my part.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 2775 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071129/5ee05071/attachment.bin 


More information about the bazaar mailing list