Comment 15 for bug 441125

Revision history for this message
John A Meinel (jameinel) wrote : Re: bzr: ERROR: exceptions.KeyError: ('makefile.am-20080508221105-rbs9wugi1qq76gcs-2', 'scott@netsplit.com-20090702173125-4nayj8jp8h4f8jnq')

Simple steps to reproduce:

bzr init base
cd base
echo a > a
echo b > b
bzr commit -m "add a & b"
cd ..
bzr branch base feature
cd feature
echo stuff >> b
bzr commit -m "added stuff"
cd ..
bzr branch base --stacked stacked-on-base
cd stacked-on-base
bzr pull ../feature
bzr reconcile
#boom

Rough analysis:

1) The 'bzr reconcile' command is trying to *only* reconcile the content in the stacked branch. (seems reasonable)
2) It iterates over the ancestry of the branch in _copy_text_texts and uses repo._get_text_key_index which is where it assumes self._text_refs will be appropriately set.
3) It does *not* filter based on the stacking boundary. The fetch 'bzr pull ../feature' doesn't fetch the text for file a revno1 because it is present in the base branch. It *does* fetch the text for file b revno2, but both (a,1) and (b,2) are referenced in revno2.
4) It goes to fetch the referenced text, and *boom*.

I *think* the fix is that it needs to find the text_refs for the inventories of parents which are present in the repository, and remove those from the needed text_refs.

Also note that the code doesn't seem to handle needing the basis inventories. Specifically if you look at "_copy_inventory_texts()" it makes a request for all inventories matching the keys present in revisions. It does not try to fill in basis inventories.

As such the 2a reconcile code seems pretty broken (in general) wrt stacked repositories. I'll see what I can do about it.