~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: John Arbash Meinel
  • Date: 2011-04-07 10:36:24 UTC
  • mfrom: (5764 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5766.
  • Revision ID: john@arbash-meinel.com-20110407103624-n76g6tjeqmznwdcd
Merge bzr.dev 5764 to resolve release-notes (aka NEWS) conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
lazy_import(globals(), """
21
21
from bzrlib import (
22
22
    branch as _mod_branch,
 
23
    cleanup,
23
24
    conflicts as _mod_conflicts,
24
25
    debug,
25
26
    generate_ids,
37
38
    versionedfile,
38
39
    workingtree,
39
40
    )
40
 
from bzrlib.cleanup import OperationWithCleanups
41
41
""")
42
42
from bzrlib import (
43
43
    decorators,
53
53
 
54
54
def transform_tree(from_tree, to_tree, interesting_ids=None):
55
55
    from_tree.lock_tree_write()
56
 
    operation = OperationWithCleanups(merge_inner)
 
56
    operation = cleanup.OperationWithCleanups(merge_inner)
57
57
    operation.add_cleanup(from_tree.unlock)
58
58
    operation.run_simple(from_tree.branch, to_tree, from_tree,
59
59
        ignore_zero=True, interesting_ids=interesting_ids, this_tree=from_tree)
501
501
    def _add_parent(self):
502
502
        new_parents = self.this_tree.get_parent_ids() + [self.other_rev_id]
503
503
        new_parent_trees = []
504
 
        operation = OperationWithCleanups(self.this_tree.set_parent_trees)
 
504
        operation = cleanup.OperationWithCleanups(
 
505
            self.this_tree.set_parent_trees)
505
506
        for revision_id in new_parents:
506
507
            try:
507
508
                tree = self.revision_tree(revision_id)
708
709
        return merge
709
710
 
710
711
    def do_merge(self):
711
 
        operation = OperationWithCleanups(self._do_merge_to)
 
712
        operation = cleanup.OperationWithCleanups(self._do_merge_to)
712
713
        self.this_tree.lock_tree_write()
713
714
        operation.add_cleanup(self.this_tree.unlock)
714
715
        if self.base_tree is not None:
820
821
            warnings.warn("pb argument to Merge3Merger is deprecated")
821
822
 
822
823
    def do_merge(self):
823
 
        operation = OperationWithCleanups(self._do_merge)
 
824
        operation = cleanup.OperationWithCleanups(self._do_merge)
824
825
        self.this_tree.lock_tree_write()
825
826
        operation.add_cleanup(self.this_tree.unlock)
826
827
        self.base_tree.lock_read()
841
842
            pass
842
843
 
843
844
    def make_preview_transform(self):
844
 
        operation = OperationWithCleanups(self._make_preview_transform)
 
845
        operation = cleanup.OperationWithCleanups(self._make_preview_transform)
845
846
        self.base_tree.lock_read()
846
847
        operation.add_cleanup(self.base_tree.unlock)
847
848
        self.other_tree.lock_read()