rfc: Change get_parent_map signature so that no parents is ()

Jelmer Vernooij jelmer at samba.org
Tue Jul 22 23:07:15 BST 2008


Hi Aaron,

Am Dienstag, den 22.07.2008, 10:45 -0400 schrieb Aaron Bentley:
> Our current implementations of get_parent_map are inconsistent in how
> they handle versions with no parents.
> 
> They are supposed to use NULL_REVISION, but many use () instead, and
> NULL_REVISION doesn't make much sense now that get_parent_map has been
> redefined to operate in terms of tuples.
> 
> I have put a lot of work into making get_parent_map use NULL_KEY
> instead.  NULL_KEY was defined as (NULL_REVISION,).  But I am finding
> that this approach adds lots and lots of API friction, and causes lots
> of confusion about where NULL_KEY should appear.  You can see my current
> work here:
> http://code.aaronbentley.com/bzr/bzrrepo/fix-plan-merge
> 
> I had something like 6000 test cases passing.  Then I fixed a test case,
> and suddenly I was back to 200 test cases passing.  It's like swimming
> in molasses.
> 
> I think the simplest fix is to just declare that get_parent_map always
> selects () when a version has no parents.  I realize that this is an API
> break.  But our API is already broken.
More consistency here would be nice indeed. The fact that
get_parent_map(X)[X] and get_revision(X).parent_ids can return a
different thing is very confusing. I would prefer an empty tuple as well
instead of (NULL_REVISION,) since that allows avoiding special casing in
a couple of places.

With my bzr-svn maintainer hat on: I wouldn't mind seeing this changed
before 1.6 as long as there's a couple of days in between the fix
landing and the actual release.

Cheers,

Jelmer
-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080723/b28a8c56/attachment-0001.pgp 


More information about the bazaar mailing list