174
174
assert kind[0] == kind[1] or None in kind
175
175
# the only 'kind change' permitted is creation/deletion
177
# If the name changes, or the parent_id changes, we have a rename
178
# (if we move a parent, that doesn't count as a rename for the file)
179
if versioned[0] != versioned[1]:
180
if versioned == (False, True) and (kind[0] != kind[1]
181
and kind[1] is not None):
182
delta.added.append((path, file_id, kind[1]))
184
assert versioned == (True, False)
185
old_path = old_tree.id2path(file_id)
186
old_kind = old_tree.kind(file_id)
187
delta.removed.append((old_path, file_id, old_kind))
188
elif kind[0] != kind[1]:
190
delta.added.append((path, file_id, kind[1]))
192
assert kind[1] is None
193
old_path = old_tree.id2path(file_id)
194
old_kind = old_tree.kind(file_id)
195
delta.removed.append((old_path, file_id, old_kind))
176
fully_present = tuple((versioned[x] and kind[x] is not None) for
178
if fully_present[1] and not fully_present[0]:
179
delta.added.append((path, file_id, kind[1]))
180
elif fully_present[0] and not fully_present[1]:
181
old_path = old_tree.id2path(file_id)
182
delta.removed.append((old_path, file_id, kind[0]))
197
183
elif name[0] != name[1] or parent_id[0] != parent_id[1]:
184
# If the name changes, or the parent_id changes, we have a rename
185
# (if we move a parent, that doesn't count as a rename for the
198
187
old_path = old_tree.id2path(file_id)
199
188
delta.renamed.append((old_path,