[MERGE] Deprecate last-revision and pending_merges.
Robert Collins
robertc at robertcollins.net
Wed Sep 6 00:57:00 BST 2006
On Tue, 2006-09-05 at 19:42 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Collins wrote:
> > This deprecates last_revision and pending_merges from the WorkingTree
> > interface in favour of get_parent_ids.
>
> Don't we want to keep last_revision as a convenience method? I notice
> several places where the elimination of last_revision has made the code
> longer. last_revision makes it easier to write correct code, rather
> than calling "get_parent_ids()[0]" without a try block.
I thought about that for a bit, and I think that no, we shouldn't.
Theres a semantic disconnect between Branch which represents a sequence
(well, graph technically) of RevisionTree's, and WorkingTree which
represents a single tree.
last-revision is entirely appropriate when you are working with a
sequence, but it does not fit WorkingTree well at all - its not
something that is defined for RevisionTree or other trees, and there is
no sequence or graph that a Tree represents - Tree is the node in the
graph.
I think that the code that is harder is temporary - if we change
WorkingTree to have an explicit first parent of 'empty:' when first
created, and thus to never have no parents, then the code that is harder
at the moment will become safe again, without the overlaid behaviour
between sequence-and-snapshot that last-revision has.
That said, while I'll argue against keeping last-revision on working
tree, I'll go with a majority if consensus is against me.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060906/c5493bdd/attachment.pgp
More information about the bazaar
mailing list