228
223
new_label + path,
229
224
new_tree.get_file(file_id).readlines(),
232
226
for old_path, new_path, file_id, kind, text_modified in delta.renamed:
233
227
print >>to_file, '=== renamed %s %r => %r' % (kind, old_path, new_path)
228
_maybe_diff_file_or_symlink(old_label, old_path, old_tree, file_id,
229
new_label, new_path, new_tree,
230
text_modified, kind, to_file, diff_file)
231
for path, file_id, kind in delta.modified:
232
print >>to_file, '=== modified %s %r' % (kind, path)
233
_maybe_diff_file_or_symlink(old_label, path, old_tree, file_id,
234
new_label, path, new_tree,
235
True, kind, to_file, diff_file)
238
def _maybe_diff_file_or_symlink(old_label, old_path, old_tree, file_id,
239
new_label, new_path, new_tree, text_modified,
240
kind, to_file, diff_file):
235
243
diff_file(old_label + old_path,
236
244
old_tree.get_file(file_id).readlines(),
237
245
new_label + new_path,
238
246
new_tree.get_file(file_id).readlines(),
241
for path, file_id, kind in delta.modified:
242
print >>to_file, '=== modified %s %r' % (kind, path)
244
diff_file(old_label + path,
245
old_tree.get_file(file_id).readlines(),
247
new_tree.get_file(file_id).readlines(),
248
elif kind == 'symlink':
249
_diff_symlink(old_tree, new_tree, file_id, to_file)
251
def _diff_symlink(old_tree, new_tree, file_id, to_file):
252
t1 = old_tree.get_symlink_target(file_id)
253
t2 = new_tree.get_symlink_target(file_id)
254
print >>to_file, '=== target changed %r => %r' % (t1, t2)