/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/mutabletree.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 00:06:46 UTC
  • mfrom: (6673 work)
  • mto: This revision was merged to the branch mainline in revision 6675.
  • Revision ID: jelmer@jelmer.uk-20170610000646-xj6jh277lo4xuo10
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
""")
43
43
 
44
44
from .decorators import needs_read_lock, needs_write_lock
 
45
from .sixish import (
 
46
    viewvalues,
 
47
    )
45
48
 
46
49
 
47
50
def needs_tree_write_lock(unbound):
551
554
    """Helper for MutableTree.smart_add."""
552
555
 
553
556
    def get_inventory_delta(self):
554
 
        return self._invdelta.values()
 
557
        # GZ 2016-06-05: Returning view would probably be fine but currently
 
558
        # Inventory.apply_delta is documented as requiring a list of changes.
 
559
        return list(viewvalues(self._invdelta))
555
560
 
556
561
    def _get_ie(self, inv_path):
557
562
        """Retrieve the most up to date inventory entry for a path.
633
638
        prev_dir = None
634
639
 
635
640
        is_inside = osutils.is_inside_or_parent_of_any
636
 
        for path, (inv_path, this_ie) in sorted(
637
 
                user_dirs.iteritems(), key=operator.itemgetter(0)):
 
641
        for path in sorted(user_dirs):
638
642
            if (prev_dir is None or not is_inside([prev_dir], path)):
 
643
                inv_path, this_ie = user_dirs[path]
639
644
                yield (path, inv_path, this_ie, None)
640
645
            prev_dir = path
641
 
        
 
646
 
642
647
    def __init__(self, tree, action, conflicts_related=None):
643
648
        self.tree = tree
644
649
        if action is None: