228
223
new_label + path,
229
224
new_tree.get_file(file_id).readlines(),
232
for old_path, new_path, file_id, kind, text_modified in delta.renamed:
233
print >>to_file, '=== renamed %s %r => %r' % (kind, old_path, new_path)
226
for (old_path, new_path, file_id, kind,
227
text_modified, meta_modified) in delta.renamed:
228
prop_str = get_prop_change(meta_modified)
229
print >>to_file, '=== renamed %s %r => %r%s' % (
230
kind, old_path, new_path, prop_str)
231
_maybe_diff_file_or_symlink(old_label, old_path, old_tree, file_id,
232
new_label, new_path, new_tree,
233
text_modified, kind, to_file, diff_file)
234
for path, file_id, kind, text_modified, meta_modified in delta.modified:
235
prop_str = get_prop_change(meta_modified)
236
print >>to_file, '=== modified %s %r%s' % (kind, path, prop_str)
234
237
if text_modified:
238
_maybe_diff_file_or_symlink(old_label, path, old_tree, file_id,
239
new_label, path, new_tree,
240
True, kind, to_file, diff_file)
243
def get_prop_change(meta_modified):
245
return " (properties changed)"
250
def _maybe_diff_file_or_symlink(old_label, old_path, old_tree, file_id,
251
new_label, new_path, new_tree, text_modified,
252
kind, to_file, diff_file):
235
255
diff_file(old_label + old_path,
236
256
old_tree.get_file(file_id).readlines(),
237
257
new_label + new_path,
238
258
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(),
260
elif kind == 'symlink':
261
_diff_symlink(old_tree, new_tree, file_id, to_file)
263
def _diff_symlink(old_tree, new_tree, file_id, to_file):
264
t1 = old_tree.get_symlink_target(file_id)
265
t2 = new_tree.get_symlink_target(file_id)
266
print >>to_file, '=== target changed %r => %r' % (t1, t2)