[MERGE] annotate on working tree with edits

John Arbash Meinel john at arbash-meinel.com
Fri Oct 5 14:50:14 BST 2007


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

Aaron Bentley wrote:
> Ian Clatworthy wrote:
>> With patch this time. :-(
>>  def annotate_file(branch, rev_id, file_id, verbose=False, full=False,
>> -                  to_file=None, show_ids=False):
>> +                  to_file=None, show_ids=False, tree=None):
> 
> bb:resubmit
> 
> This is an awful lot of parameters.  At first glance, a lot of them seem
> redundant.
> 
> In theory, we don't need branch, because we have rev_id.

I'm pretty sure we do, because we want the dotted revnos to be relative to the
branch tip, not the revision_id we are annotating. Otherwise if you did:

  bzr annotate -r 10.1.1 foo.py

You would see "11" for lines that were modified in '10.1.1'. (Because when it
is the tip, it is the 11th mainline commit.)

Also, we need a place to *get* all of those revision => revision_ids, and to
get the Revision objects (branch.repository).

(I just realized that you might use 'tree' for this, but you certainly need at
least one of tree or branch, not just a revision id.)

> 
> It would be really nice if there was a Tree.closest_revision() method.
> For revision trees, it would be equivalent to
> RevisionTree.get_revision_id, and for WorkingTrees, it would be
> equivalent to WorkingTree.last_revision().  I've run into several places
> (e.g. merge code) where we wanted something like this.
> 
> If we had Tree.closest_revision, we wouldn't need rev_id either.
> 
> So we could just have a Tree and a Repository as the inputs.
> 
> That being said, since our API isn't there, I'd like to see tree as a
> mandatory parameter.

I agree that we should favor tree over branch. Just that we've been maintaining
api compatibility.

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

iD8DBQFHBkEKJdeBCYSNAAMRAitqAJ99NWJtCtlhc1MzWFbQcaXFETKZ8gCgk2mO
PsJ7xWiVNNDRBlOGpQermfE=
=Q3ef
-----END PGP SIGNATURE-----



More information about the bazaar mailing list