~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Michael Hudson
  • Date: 2007-11-27 13:58:49 UTC
  • mto: (3008.1.10 tree-less-merge-diffs)
  • mto: This revision was merged to the branch mainline in revision 3189.
  • Revision ID: michael.hudson@canonical.com-20071127135849-yw00pfi6nrs5twf6
wanton hacking that lets me write an efficient version of get_diff_as_merged
that works at least sometimes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
from bzrlib.revision import (is_ancestor, NULL_REVISION, ensure_null)
48
48
from bzrlib.textfile import check_text_lines
49
49
from bzrlib.trace import mutter, warning, note
50
 
from bzrlib.transform import (TreeTransform, resolve_conflicts, cook_conflicts,
 
50
from bzrlib.transform import (TransformPreview, TreeTransform,
 
51
                              resolve_conflicts, cook_conflicts,
51
52
                              conflict_pass, FinalPaths, create_by_entry,
52
53
                              unique_add, ROOT_PARENT)
53
54
from bzrlib.versionedfile import PlanWeaveMerge
484
485
            self.this_tree.unlock()
485
486
            self.pb.clear()
486
487
 
 
488
    def make_preview_transform(self):
 
489
        self.base_tree.lock_read()
 
490
        self.other_tree.lock_read()
 
491
        self.tt = TransformPreview(self.this_tree)
 
492
        try:
 
493
            self.pp.next_phase()
 
494
            self.compute_transform()
 
495
            self.pp.next_phase()
 
496
        finally:
 
497
            self.other_tree.unlock()
 
498
            self.base_tree.unlock()
 
499
            self.pb.clear()
 
500
        return self.tt
 
501
 
487
502
    def compute_transform(self):
488
503
        entries = self._entries3()
489
504
        child_pb = ui.ui_factory.nested_progress_bar()