~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

(gz) Bug #613247, cleanup test cases when they are finished running,
 lowering peak memory during selftest. (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    versionedfile,
39
39
    workingtree,
40
40
    )
 
41
from bzrlib.i18n import gettext
41
42
""")
42
43
from bzrlib import (
43
44
    decorators,
711
712
        merge = operation.run_simple()
712
713
        if len(merge.cooked_conflicts) == 0:
713
714
            if not self.ignore_zero and not trace.is_quiet():
714
 
                trace.note("All changes applied successfully.")
 
715
                trace.note(gettext("All changes applied successfully."))
715
716
        else:
716
 
            trace.note("%d conflicts encountered."
 
717
            trace.note(gettext("%d conflicts encountered.")
717
718
                       % len(merge.cooked_conflicts))
718
719
 
719
720
        return len(merge.cooked_conflicts)
858
859
            self.active_hooks = [hook for hook in hooks if hook is not None]
859
860
            for num, (file_id, changed, parents3, names3,
860
861
                      executable3) in enumerate(entries):
861
 
                child_pb.update('Preparing file merge', num, len(entries))
 
862
                child_pb.update(gettext('Preparing file merge'), num, len(entries))
862
863
                self._merge_names(file_id, parents3, names3, resolver=resolver)
863
864
                if changed:
864
865
                    file_status = self._do_merge_contents(file_id)
1635
1636
                if other_parent is None or other_name is None:
1636
1637
                    other_path = '<deleted>'
1637
1638
                else:
1638
 
                    parent_path =  fp.get_path(
1639
 
                        self.tt.trans_id_file_id(other_parent))
 
1639
                    if other_parent == self.other_tree.get_root_id():
 
1640
                        # The tree transform doesn't know about the other root,
 
1641
                        # so we special case here to avoid a NoFinalPath
 
1642
                        # exception
 
1643
                        parent_path = ''
 
1644
                    else:
 
1645
                        parent_path =  fp.get_path(
 
1646
                            self.tt.trans_id_file_id(other_parent))
1640
1647
                    other_path = osutils.pathjoin(parent_path, other_name)
1641
1648
                c = _mod_conflicts.Conflict.factory(
1642
1649
                    'path conflict', path=this_path,
1900
1907
            entries = self._entries_to_incorporate()
1901
1908
            entries = list(entries)
1902
1909
            for num, (entry, parent_id) in enumerate(entries):
1903
 
                child_pb.update('Preparing file merge', num, len(entries))
 
1910
                child_pb.update(gettext('Preparing file merge'), num, len(entries))
1904
1911
                parent_trans_id = self.tt.trans_id_file_id(parent_id)
1905
1912
                trans_id = transform.new_by_entry(self.tt, entry,
1906
1913
                    parent_trans_id, self.other_tree)