253
253
if ie.revision != default_revision_id:
254
254
action.add_property('last-changed', ie.revision)
256
def finish_action(action, file_id, kind, meta_modified, text_modified,
258
do_revision(file_id, action)
260
do_meta(file_id, action)
261
if text_modified and kind == "symlink":
262
do_target(new_tree.inventory[file_id].symlink_target, action)
263
if text_modified and kind == "file":
264
do_diff(old_path, file_id, new_path, text_modified, action)
266
action.write(self.to_file)
256
268
delta = compare_trees(old_tree, new_tree, want_unchanged=False)
259
self.to_file.write(text.encode('utf-8'))
261
270
for path, file_id, kind in delta.removed:
262
271
action = Action('removed', [kind, path]).write(self.to_file)
264
273
for path, file_id, kind in delta.added:
265
274
action = Action('added', [kind, path], [('file-id', file_id)])
266
do_revision(file_id, action)
268
do_meta(file_id, action)
269
if kind == 'symlink':
270
do_target(new_tree.inventory[file_id].symlink_target, action)
272
do_diff(DEVNULL, file_id, path, kind, action)
274
action.write(self.to_file)
275
finish_action(action, file_id, kind, True, True,
277
278
for (old_path, new_path, file_id, kind,
278
279
text_modified, meta_modified) in delta.renamed:
279
280
action = Action('renamed', [kind, old_path], [(new_path,)])
280
do_revision(file_id, action)
283
if text_modified and kind == "symlink":
284
do_target(new_tree.inventory[file_id].symlink_target, action)
285
if text_modified and kind == "file":
286
do_diff(old_path, file_id, new_path, text_modified, action)
288
action.write(self.to_file)
281
finish_action(action, file_id, kind, meta_modified, text_modified,
290
284
for (path, file_id, kind,
291
285
text_modified, meta_modified) in delta.modified:
292
# TODO: Handle meta_modified
293
#prop_str = get_prop_change(meta_modified)
294
286
action = Action('modified', [kind, path])
295
do_revision(file_id, action)
297
do_meta(file_id, action)
298
if text_modified and kind == "symlink":
299
do_target(new_tree.inventory[file_id].symlink_target, action)
300
if text_modified and kind == "file":
301
do_diff(path, file_id, path, kind, action)
303
action.write(self.to_file)
287
finish_action(action, file_id, kind, meta_modified, text_modified,