~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-11-11 08:45:19 UTC
  • mfrom: (4597.9.22 reports-conflict-resolved)
  • Revision ID: pqm@pqm.ubuntu.com-20101111084519-bmk1zmblp7kex41a
(vila) More feedback about the conflicts just resolved and the remaining
 ones. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
            elif len(lcas) == 1:
583
583
                self.base_rev_id = list(lcas)[0]
584
584
            else: # len(lcas) > 1
585
 
                self._is_criss_cross = True
586
585
                if len(lcas) > 2:
587
586
                    # find_unique_lca can only handle 2 nodes, so we have to
588
587
                    # start back at the beginning. It is a shame to traverse
593
592
                else:
594
593
                    self.base_rev_id = self.revision_graph.find_unique_lca(
595
594
                                            *lcas)
596
 
                sorted_lca_keys = self.revision_graph.find_merge_order(                
597
 
                    revisions[0], lcas)
598
 
                if self.base_rev_id == _mod_revision.NULL_REVISION:
599
 
                    self.base_rev_id = sorted_lca_keys[0]
600
 
                
 
595
                self._is_criss_cross = True
601
596
            if self.base_rev_id == _mod_revision.NULL_REVISION:
602
597
                raise errors.UnrelatedBranches()
603
598
            if self._is_criss_cross:
604
599
                trace.warning('Warning: criss-cross merge encountered.  See bzr'
605
600
                              ' help criss-cross.')
606
601
                trace.mutter('Criss-cross lcas: %r' % lcas)
607
 
                if self.base_rev_id in lcas:
608
 
                    trace.mutter('Unable to find unique lca. '
609
 
                                 'Fallback %r as best option.' % self.base_rev_id)
610
 
                interesting_revision_ids = set(lcas)
611
 
                interesting_revision_ids.add(self.base_rev_id)
 
602
                interesting_revision_ids = [self.base_rev_id]
 
603
                interesting_revision_ids.extend(lcas)
612
604
                interesting_trees = dict((t.get_revision_id(), t)
613
605
                    for t in self.this_branch.repository.revision_trees(
614
606
                        interesting_revision_ids))
615
607
                self._cached_trees.update(interesting_trees)
616
 
                if self.base_rev_id in lcas:
617
 
                    self.base_tree = interesting_trees[self.base_rev_id]
618
 
                else:
619
 
                    self.base_tree = interesting_trees.pop(self.base_rev_id)
 
608
                self.base_tree = interesting_trees.pop(self.base_rev_id)
 
609
                sorted_lca_keys = self.revision_graph.find_merge_order(
 
610
                    revisions[0], lcas)
620
611
                self._lca_trees = [interesting_trees[key]
621
612
                                   for key in sorted_lca_keys]
622
613
            else: