Bazaar Version Control System

Comment 2 for bug 232113

John A Meinel (jameinel) wrote :

So... 'remerge' first resolves the tree as clean, before it then re-applies a merge. So when remerge had an exception in the middle, you were left in a semi-resolved state.

The second bit...

It sounds like the "--format=lca" merge code is failing because a file is missing in one of the ancestors. If we had a traceback it would be easier to localize what code is expecting it to exist when it doesn't.

Poking my head through the code, the function I would suspect on the "WT has not attribute repository" is this one:

    def _iter_parent_trees(self):
        """Iterate through parent trees, defaulting to Tree.revision_tree."""
        for revision_id in self.get_parent_ids():
                yield self.revision_tree(revision_id)
            except errors.NoSuchRevisionInTree:
                yield self.repository.revision_tree(revision_id)

It is defined on "Tree._iter_parent_trees()" however it should only be defined that way for RevisionTree, as WT and Mutable tree only have self.branch.repository not a direct self.repository.

And "_iter_parent_trees" is only being called as part of Tree._get_file_revision(), which is called by "_get_plan_merge_data", which is called by both plan_file_merge and plan_file_lca_merge.

My first guess is that we don't typically run into this, because for the parent_ids of a WorkingTreeFormat4 (dirstate+) we always cache the parents, so "self.revision_tree()" is typically not raising an error.

Oh, I also just noticed that _get_file_revision() seems to have an explicit check for "getattr(self, '_repository', None) is not None" before it calls _iter_parent_trees. So it shouldn't actually call it. Without an actual traceback, I'm sort of poking around blind.