251
251
# Find all the changed blobs
252
for (file_id, path, changed_content, versioned, parent, name, kind,
253
executable) in tree.iter_changes(base_tree):
254
if name[1] in BANNED_FILENAMES:
252
for change in tree.iter_changes(base_tree):
253
if change.name[1] in BANNED_FILENAMES:
256
if kind[1] == "file":
257
sha1 = tree.get_file_sha1(path[1])
255
if change.kind[1] == "file":
256
sha1 = tree.get_file_sha1(change.path[1])
260
259
(pfile_id, prevision) = find_unchanged_parent_ie(
261
file_id, kind[1], sha1, other_parent_trees)
260
change.file_id, change.kind[1], sha1, other_parent_trees)
271
270
if not changed_content:
272
271
# no-change merge ?
274
blob.data = tree.get_file_text(path[1])
273
blob.data = tree.get_file_text(change.path[1])
275
274
blob_id = blob.id
276
275
if blob_id is None:
277
new_blobs.append((path[1], file_id))
276
new_blobs.append((change.path[1], change.file_id))
279
278
shamap[path[1]] = blob_id
280
279
if add_cache_entry is not None:
282
281
("blob", blob_id),
283
(file_id, tree.get_file_revision(path[1])), path[1])
284
elif kind[1] == "symlink":
285
target = tree.get_symlink_target(path[1])
282
(file_id, tree.get_file_revision(change.path[1])), change.path[1])
283
elif change.kind[1] == "symlink":
284
target = tree.get_symlink_target(change.path[1])
286
285
blob = symlink_to_blob(target)
287
shamap[path[1]] = blob.id
286
shamap[change.path[1]] = blob.id
288
287
if add_cache_entry is not None:
290
blob, (file_id, tree.get_file_revision(path[1])), path[1])
289
blob, (change.file_id, tree.get_file_revision(change.path[1])), change.path[1])
292
291
find_unchanged_parent_ie(
293
file_id, kind[1], target, other_parent_trees)
292
change.file_id, change.kind[1], target, other_parent_trees)
296
yield (path[1], blob,
297
(file_id, tree.get_file_revision(path[1])))
298
elif kind[1] is None:
299
shamap[path[1]] = None
300
elif kind[1] != 'directory':
301
raise AssertionError(kind[1])
294
if change.changed_content:
295
yield (change.path[1], blob,
296
(change.file_id, tree.get_file_revision(change.path[1])))
297
elif change.kind[1] is None:
298
shamap[change.path[1]] = None
299
elif change.kind[1] != 'directory':
300
raise AssertionError(change.kind[1])
301
for p in change.path:
305
304
dirty_dirs.add(osutils.dirname(p))