[MERGE] annotate in the branch context

John Arbash Meinel john at arbash-meinel.com
Mon Jan 29 21:21:38 GMT 2007


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

Our current implementation of "bzr annotate" asks the weave to annotate
itself based on a given revision id for a file.

It determines that revision id from
RevisionTree.inventory[file_id].revision. Which is reasonable, since it
gives the last-modified revision of the file.

However, when it generates dotted revnos, it uses that same revision_id.
Which fails when the file was last modified in a non-mainline revision.

Specifically, if you do:

bzr annotate BRANCH.TODO

It will say that lines were last modified at revno 2055. But 2055 in
bzr.dev is one of Alexander's patches.

If you look closer, you find out that in the branch Andrew was working
on, it was commit 2055. But obviously once that is merged, the dotted
representation changed.

This has actually been buggy since the new dotted revno changes. The old
code just looked up the offset in Branch.revision_history.

It can also be argued that this is a regression from 0.13.

The attached patch fixes it to generate the dotted revnos from the
viewpoint of Branch.last_revision().

It also cleans up some of the test_annotate helper functions. Since even
though I was the one that wrote them, it wasn't clear to me what they
were doing. :)

John
=:->

PS> Wouter: do you think this is sufficient to create a bzr-0.14.1?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFvmViJdeBCYSNAAMRAnV/AJ9BeoKa33RVPFGg4QUoYClikalNZgCgg4lw
XgxqSgDgXbc81znqKlxrVNs=
=rId9
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotate_revnos.patch
Type: text/x-patch
Size: 5222 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070129/5e93774b/attachment.bin 


More information about the bazaar mailing list