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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-06-15 17:53:40 UTC
  • mfrom: (7322.1.8 objects-1)
  • Revision ID: breezy.the.bot@gmail.com-20190615175340-yxo036zu96wh8lcz
Use the new attributes on TreeChange rather than indexing.

Merged from https://code.launchpad.net/~jelmer/brz/objects-1/+merge/368859

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                      minimum_path_selection,
70
70
                      )
71
71
from .trace import mutter, note, is_quiet
 
72
from .tree import TreeChange
72
73
from .urlutils import unescape_for_display
73
74
from .i18n import gettext
74
75
 
96
97
    :return: iter_changes function
97
98
    """
98
99
    for change in iter_changes:
99
 
        old_path = change[1][0]
100
 
        new_path = change[1][1]
101
 
 
102
 
        new_excluded = (new_path is not None and
103
 
                        is_inside_any(exclude, new_path))
104
 
 
105
 
        old_excluded = (old_path is not None and
106
 
                        is_inside_any(exclude, old_path))
 
100
        new_excluded = (change.path[1] is not None and
 
101
                        is_inside_any(exclude, change.path[1]))
 
102
 
 
103
        old_excluded = (change.path[0] is not None and
 
104
                        is_inside_any(exclude, change.path[0]))
107
105
 
108
106
        if old_excluded and new_excluded:
109
107
            continue
701
699
        deleted_paths = []
702
700
        for change in iter_changes:
703
701
            if report_changes:
704
 
                old_path = change[1][0]
705
 
                new_path = change[1][1]
706
 
                versioned = change[3][1]
707
 
            kind = change[6][1]
708
 
            versioned = change[3][1]
 
702
                old_path = change.path[0]
 
703
                new_path = change.path[1]
 
704
                versioned = change.versioned[1]
 
705
            kind = change.kind[1]
 
706
            versioned = change.versioned[1]
709
707
            if kind is None and versioned:
710
708
                # 'missing' path
711
709
                if report_changes:
712
710
                    reporter.missing(new_path)
713
 
                if change[6][0] == 'symlink' and not self.work_tree.supports_symlinks():
 
711
                if change.kind[0] == 'symlink' and not self.work_tree.supports_symlinks():
714
712
                    trace.warning('Ignoring "%s" as symlinks are not '
715
 
                                  'supported on this filesystem.' % (change[1][0],))
 
713
                                  'supported on this filesystem.' % (change.path[0],))
716
714
                    continue
717
715
                deleted_paths.append(change[1][1])
718
716
                # Reset the new path (None) and new versioned flag (False)
719
 
                change = (change[0], (change[1][0], None), change[2],
720
 
                          (change[3][0], False)) + change[4:]
721
 
                new_path = change[1][1]
 
717
                change = change.discard_new()
 
718
                new_path = change.path[1]
722
719
                versioned = False
723
720
            elif kind == 'tree-reference':
724
721
                if self.recursive == 'down':
725
722
                    self._commit_nested_tree(change[1][1])
726
 
            if change[3][0] or change[3][1]:
 
723
            if change.versioned[0] or change.versioned[1]:
727
724
                yield change
728
725
                if report_changes:
729
726
                    if new_path is None: