/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/plugins/fastimport/revision_store.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:
25
25
    osutils,
26
26
    revision as _mod_revision,
27
27
    )
 
28
from ...tree import TreeChange
28
29
from ...bzr import (
29
30
    inventory,
30
31
    )
118
119
                old_ie = None
119
120
                if ie is None:
120
121
                    raise AssertionError('How is both old and new None?')
121
 
                    change = (file_id,
122
 
                              (old_path, new_path),
123
 
                              False,
124
 
                              (False, False),
125
 
                              (None, None),
126
 
                              (None, None),
127
 
                              (None, None),
128
 
                              (None, None),
129
 
                              )
130
 
                change = (file_id,
131
 
                          (old_path, new_path),
132
 
                          True,
133
 
                          (False, True),
134
 
                          (None, ie.parent_id),
135
 
                          (None, ie.name),
136
 
                          (None, ie.kind),
137
 
                          (None, ie.executable),
138
 
                          )
 
122
                    change = TreeChange(
 
123
                        file_id,
 
124
                        (old_path, new_path),
 
125
                        False,
 
126
                        (False, False),
 
127
                        (None, None),
 
128
                        (None, None),
 
129
                        (None, None),
 
130
                        (None, None),
 
131
                        )
 
132
                change = TreeChange(
 
133
                    file_id,
 
134
                    (old_path, new_path),
 
135
                    True,
 
136
                    (False, True),
 
137
                    (None, ie.parent_id),
 
138
                    (None, ie.name),
 
139
                    (None, ie.kind),
 
140
                    (None, ie.executable),
 
141
                    )
139
142
            else:
140
143
                if ie is None:
141
 
                    change = (file_id,
142
 
                              (old_path, new_path),
143
 
                              True,
144
 
                              (True, False),
145
 
                              (old_ie.parent_id, None),
146
 
                              (old_ie.name, None),
147
 
                              (old_ie.kind, None),
148
 
                              (old_ie.executable, None),
149
 
                              )
 
144
                    change = TreeChange(
 
145
                        file_id,
 
146
                        (old_path, new_path),
 
147
                        True,
 
148
                        (True, False),
 
149
                        (old_ie.parent_id, None),
 
150
                        (old_ie.name, None),
 
151
                        (old_ie.kind, None),
 
152
                        (old_ie.executable, None),
 
153
                        )
150
154
                else:
151
155
                    content_modified = (ie.text_sha1 != old_ie.text_sha1 or
152
156
                                        ie.text_size != old_ie.text_size)
153
157
                    # TODO: ie.kind != old_ie.kind
154
158
                    # TODO: symlinks changing targets, content_modified?
155
 
                    change = (file_id,
156
 
                              (old_path, new_path),
157
 
                              content_modified,
158
 
                              (True, True),
159
 
                              (old_ie.parent_id, ie.parent_id),
160
 
                              (old_ie.name, ie.name),
161
 
                              (old_ie.kind, ie.kind),
162
 
                              (old_ie.executable, ie.executable),
163
 
                              )
 
159
                    change = TreeChange(
 
160
                        file_id,
 
161
                        (old_path, new_path),
 
162
                        content_modified,
 
163
                        (True, True),
 
164
                        (old_ie.parent_id, ie.parent_id),
 
165
                        (old_ie.name, ie.name),
 
166
                        (old_ie.kind, ie.kind),
 
167
                        (old_ie.executable, ie.executable),
 
168
                        )
164
169
            yield change
165
170
 
166
171