/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-02-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from __future__ import absolute_import
18
18
 
19
 
import contextlib
20
 
 
21
19
from .lazy_import import lazy_import
22
20
lazy_import(globals(), """
23
21
import patiencediff
24
22
 
25
23
from breezy import (
26
24
    branch as _mod_branch,
 
25
    cleanup,
27
26
    conflicts as _mod_conflicts,
28
27
    debug,
29
28
    graph as _mod_graph,
50
49
    hooks,
51
50
    registry,
52
51
    )
 
52
from .sixish import (
 
53
    viewitems,
 
54
    )
53
55
# TODO: Report back as changes are merged in
54
56
 
55
57
 
445
447
    def _add_parent(self):
446
448
        new_parents = self.this_tree.get_parent_ids() + [self.other_rev_id]
447
449
        new_parent_trees = []
448
 
        with contextlib.ExitStack() as stack:
 
450
        with cleanup.ExitStack() as stack:
449
451
            for revision_id in new_parents:
450
452
                try:
451
453
                    tree = self.revision_tree(revision_id)
652
654
        return merge
653
655
 
654
656
    def do_merge(self):
655
 
        with contextlib.ExitStack() as stack:
 
657
        with cleanup.ExitStack() as stack:
656
658
            stack.enter_context(self.this_tree.lock_tree_write())
657
659
            if self.base_tree is not None:
658
660
                stack.enter_context(self.base_tree.lock_read())
755
757
            self.do_merge()
756
758
 
757
759
    def do_merge(self):
758
 
        with contextlib.ExitStack() as stack:
 
760
        with cleanup.ExitStack() as stack:
759
761
            stack.enter_context(self.working_tree.lock_tree_write())
760
762
            stack.enter_context(self.this_tree.lock_read())
761
763
            stack.enter_context(self.base_tree.lock_read())
2253
2255
        filtered_parent_map = {}
2254
2256
        child_map = {}
2255
2257
        tails = []
2256
 
        for key, parent_keys in parent_map.items():
 
2258
        for key, parent_keys in viewitems(parent_map):
2257
2259
            culled_parent_keys = [p for p in parent_keys if p in parent_map]
2258
2260
            if not culled_parent_keys:
2259
2261
                tails.append(key)