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

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> 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
> =:->

I think I'm mistaken that is_ancestor() is part of bug 172970. However, it is a
pack regression, and this does improve it. It is more about "bzr merge"
performance than "bzr pull" into a branch without a tree though....

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHT4bNJdeBCYSNAAMRAu/vAKC6nek5I/b4U6zWIsWrbSzgiYl8ygCgot2h
rhb1DNWy++fxDMwv8W2s83o=
=D6F1
-----END PGP SIGNATURE-----



More information about the bazaar mailing list