Small patch for CHK branch to fix some tests

Robert Collins robertc at robertcollins.net
Tue Nov 4 04:22:45 GMT 2008


On Tue, 2008-11-04 at 15:16 +1100, Andrew Bennetts wrote:
> Robert Collins wrote:
> > On Tue, 2008-11-04 at 13:40 +1100, Andrew Bennetts wrote:
> > > Hi Robert,
> > > 
> > > I haven't run the full suite, but this patch appears to help at least
> > > test_upgrade_preserves_signatures, and makes one variant of test_fetch_knit3 get
> > > a little further along too.  I bumped into these yesterday while playing with
> > > usertest on your branch.
> > 
> > Setting the children directly is not permitted in the new code; allowing
> > that would be more than a little complex. So I'm not inclined to merge
> > that part of the patch without more understanding of what is failing and
> > why.
> 
> Something was trying to assign to it.  I'll repeat and give you a more specific
> exception in a little while.  (I foolishly let the exception disappear off my
> scrollback.)

Ok. The reason assigning child is stricky is that it needs to be
synchronised with changes to _byid in regular inventories, and with
multiple map changes in chk inventories; which implies back references
from nodes to the root; I want to avoid that to allow cow nodes - so all
changes need to be done to the Inventory object only. (Via apply_delta).

> > The other change would seem to be a no-op, could you expand on why its
> > needed?
> 
> CHKInventory doesn't provide ._byid (and neither does the CommonInventory base
> class).  But it does provide __iter__, which is just as good here, and using
> that was easier than implementing a _byid for CHKInventory.

Alternatively, CHKInventory should be able to provide a much faster
inventory delta directly, so rather than penalising regular inventories
(which __iter__ does - we use _byid because its *fast*) this seems like
a possible spot to hook in a direct CHKInventory<->CHKInventory deltas.

-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: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081104/32a3e485/attachment.pgp 


More information about the bazaar mailing list