[MERGE] Updates to annotate
John Arbash Meinel
john at arbash-meinel.com
Wed Feb 20 22:26:52 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The attached patch changes how annotate works. This isn't the last step that
I'll be doing to refine annotate, but it does make a significant improvement.
Basically, this patch adds an annotate helper class, and changes the reannotate
algorithm.
The idea of the helper class is that I would eventually like to expose it at a
higher level for things like gannotate. So that when reannotating the same file
at a different revision, it can use all the information that was already cached
in the first attempt. (The current structure of gannotate makes that a little
bit difficult to do, and right now the biggest overhead is actually in
"get_revision_graph()" and not the annotate time.)
Anyway, with this patch, I see a 2-3x improvement for annotating
bzrlib/repository.py or other long lived files. And it does it by doing a diff
on the annotated texts, which allows us to have large regions that we know are
unchanged. Which is by far the common case in histories. (2 sides might both
change regions, but the bulk of the file stays the same.)
It also fixes our resolution when we have lines that both sides introduced. The
knit algorithm always assigned the lines to the right-most match. The pack
algorithm would assign it to the merge revision whenever there was a dispute,
which meant that repeated merges could keep bumping the last-modified up for
every merge.
The new algorithm uses heads() to determine when one side has already resolved
the ambiguity which prevents it from "bleeding" into future merges.
It is always nice when fixing correctness also makes things faster. (Note that
it would be even faster if we restored "always assign to right", but at least it
is faster than "always assign tip".)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHvKksJdeBCYSNAAMRAsFNAJwPF0OgYRnjR3UPEB2J6nw0ZFqZ+QCfWkw8
8aYegZrY+LACRm0use9ZCKs=
=+30S
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: annotate_cleanup.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080220/51ee8b6f/attachment-0001.diff
More information about the bazaar
mailing list