/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: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
 
17
import contextlib
18
18
 
19
19
from .lazy_import import lazy_import
20
20
lazy_import(globals(), """
22
22
 
23
23
from breezy import (
24
24
    branch as _mod_branch,
25
 
    cleanup,
26
25
    conflicts as _mod_conflicts,
27
26
    debug,
28
27
    graph as _mod_graph,
49
48
    hooks,
50
49
    registry,
51
50
    )
52
 
from .sixish import (
53
 
    viewitems,
54
 
    )
55
51
# TODO: Report back as changes are merged in
56
52
 
57
53
 
447
443
    def _add_parent(self):
448
444
        new_parents = self.this_tree.get_parent_ids() + [self.other_rev_id]
449
445
        new_parent_trees = []
450
 
        with cleanup.ExitStack() as stack:
 
446
        with contextlib.ExitStack() as stack:
451
447
            for revision_id in new_parents:
452
448
                try:
453
449
                    tree = self.revision_tree(revision_id)
654
650
        return merge
655
651
 
656
652
    def do_merge(self):
657
 
        with cleanup.ExitStack() as stack:
 
653
        with contextlib.ExitStack() as stack:
658
654
            stack.enter_context(self.this_tree.lock_tree_write())
659
655
            if self.base_tree is not None:
660
656
                stack.enter_context(self.base_tree.lock_read())
757
753
            self.do_merge()
758
754
 
759
755
    def do_merge(self):
760
 
        with cleanup.ExitStack() as stack:
 
756
        with contextlib.ExitStack() as stack:
761
757
            stack.enter_context(self.working_tree.lock_tree_write())
762
758
            stack.enter_context(self.this_tree.lock_read())
763
759
            stack.enter_context(self.base_tree.lock_read())
2255
2251
        filtered_parent_map = {}
2256
2252
        child_map = {}
2257
2253
        tails = []
2258
 
        for key, parent_keys in viewitems(parent_map):
 
2254
        for key, parent_keys in parent_map.items():
2259
2255
            culled_parent_keys = [p for p in parent_keys if p in parent_map]
2260
2256
            if not culled_parent_keys:
2261
2257
                tails.append(key)