~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-30 02:19:16 UTC
  • mto: (3697.7.4 1.7)
  • mto: This revision was merged to the branch mainline in revision 3748.
  • Revision ID: john@arbash-meinel.com-20080730021916-65dpdenvz27emgnk
Handle when there are more than 2 LCAs while searching for the unique lca.

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
            elif len(lcas) == 1:
364
364
                self.base_rev_id = list(lcas)[0]
365
365
            else: # len(lcas) > 1
366
 
                self.base_rev_id = self.revision_graph.find_unique_lca(
367
 
                                        *lcas)
 
366
                if len(lcas) > 2:
 
367
                    # find_unique_lca can only handle 2 nodes, so we have to
 
368
                    # start back at the beginning. It is a shame to traverse
 
369
                    # the graph again, but better than re-implementing
 
370
                    # find_unique_lca.
 
371
                    self.base_rev_id = self.revision_graph.find_unique_lca(
 
372
                                            revisions[0], revisions[1])
 
373
                else:
 
374
                    self.base_rev_id = self.revision_graph.find_unique_lca(
 
375
                                            *lcas)
368
376
                self._is_criss_cross = True
369
377
            if self.base_rev_id == NULL_REVISION:
370
378
                raise UnrelatedBranches()