/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 breezy/merge.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-08-07 21:24:40 UTC
  • mfrom: (7058.4.30 python3-x)
  • Revision ID: breezy.the.bot@gmail.com-20180807212440-m7r0c45ihwr0kcre
Fix another round of tests on Python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-x/+merge/352226

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
 
60
60
def transform_tree(from_tree, to_tree, interesting_files=None):
61
 
    from_tree.lock_tree_write()
62
 
    operation = cleanup.OperationWithCleanups(merge_inner)
63
 
    operation.add_cleanup(from_tree.unlock)
64
 
    operation.run_simple(from_tree.branch, to_tree, from_tree,
65
 
        ignore_zero=True, this_tree=from_tree,
66
 
        interesting_files=interesting_files)
 
61
    with from_tree.lock_tree_write():
 
62
        merge_inner(from_tree.branch, to_tree, from_tree,
 
63
            ignore_zero=True, this_tree=from_tree,
 
64
            interesting_files=interesting_files)
67
65
 
68
66
 
69
67
class MergeHooks(hooks.Hooks):
788
786
            pass
789
787
 
790
788
    def make_preview_transform(self):
791
 
        operation = cleanup.OperationWithCleanups(self._make_preview_transform)
792
 
        self.base_tree.lock_read()
793
 
        operation.add_cleanup(self.base_tree.unlock)
794
 
        self.other_tree.lock_read()
795
 
        operation.add_cleanup(self.other_tree.unlock)
796
 
        return operation.run_simple()
797
 
 
798
 
    def _make_preview_transform(self):
799
 
        self.tt = transform.TransformPreview(self.working_tree)
800
 
        self._compute_transform()
801
 
        return self.tt
 
789
        with self.base_tree.lock_read(), self.other_tree.lock_read():
 
790
            self.tt = transform.TransformPreview(self.working_tree)
 
791
            self._compute_transform()
 
792
            return self.tt
802
793
 
803
794
    def _compute_transform(self):
804
795
        if self._lca_trees is None: