/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2009-09-29 04:40:55 UTC
  • mfrom: (4717 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4718.
  • Revision ID: aaron@aaronbentley.com-20090929044055-e9jtpmz6eyut711h
Merged bzr.dev into fix_get_mtime.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        self._is_criss_cross = None
107
107
        self._lca_trees = None
108
108
 
 
109
    def cache_trees_with_revision_ids(self, trees):
 
110
        """Cache any tree in trees if it has a revision_id."""
 
111
        for maybe_tree in trees:
 
112
            if maybe_tree is None:
 
113
                continue
 
114
            try:
 
115
                rev_id = maybe_tree.get_revision_id()
 
116
            except AttributeError:
 
117
                continue
 
118
            self._cached_trees[rev_id] = maybe_tree
 
119
 
109
120
    @property
110
121
    def revision_graph(self):
111
122
        if self._revision_graph is None:
602
613
        self.this_tree.lock_tree_write()
603
614
        self.base_tree.lock_read()
604
615
        self.other_tree.lock_read()
605
 
        self.tt = TreeTransform(self.this_tree, self.pb)
606
616
        try:
607
 
            self.pp.next_phase()
608
 
            self._compute_transform()
609
 
            self.pp.next_phase()
610
 
            results = self.tt.apply(no_conflicts=True)
611
 
            self.write_modified(results)
 
617
            self.tt = TreeTransform(self.this_tree, self.pb)
612
618
            try:
613
 
                self.this_tree.add_conflicts(self.cooked_conflicts)
614
 
            except UnsupportedOperation:
615
 
                pass
 
619
                self.pp.next_phase()
 
620
                self._compute_transform()
 
621
                self.pp.next_phase()
 
622
                results = self.tt.apply(no_conflicts=True)
 
623
                self.write_modified(results)
 
624
                try:
 
625
                    self.this_tree.add_conflicts(self.cooked_conflicts)
 
626
                except UnsupportedOperation:
 
627
                    pass
 
628
            finally:
 
629
                self.tt.finalize()
616
630
        finally:
617
 
            self.tt.finalize()
618
631
            self.other_tree.unlock()
619
632
            self.base_tree.unlock()
620
633
            self.this_tree.unlock()
1520
1533
    get_revision_id = getattr(base_tree, 'get_revision_id', None)
1521
1534
    if get_revision_id is None:
1522
1535
        get_revision_id = base_tree.last_revision
 
1536
    merger.cache_trees_with_revision_ids([other_tree, base_tree, this_tree])
1523
1537
    merger.set_base_revision(get_revision_id(), this_branch)
1524
1538
    return merger.do_merge()
1525
1539