1060
1060
def get_encoded_path(path):
1061
1061
if path is not None:
1062
1062
return path.encode(self.path_encoding, "replace")
1063
for (file_id, paths, changed_content, versioned, parent, name, kind,
1064
executable) in sorted(iterator, key=changes_key):
1063
for change in sorted(iterator, key=changes_key):
1065
1064
# The root does not get diffed, and items with no known kind (that
1066
1065
# is, missing) in both trees are skipped as well.
1067
if parent == (None, None) or kind == (None, None):
1066
if change.parent_id == (None, None) or change.kind == (None, None):
1069
if kind[0] == 'symlink' and not self.new_tree.supports_symlinks():
1068
if change.kind[0] == 'symlink' and not self.new_tree.supports_symlinks():
1071
1070
'Ignoring "%s" as symlinks are not '
1072
'supported on this filesystem.' % (paths[0],))
1071
'supported on this filesystem.' % (change.path[0],))
1074
oldpath, newpath = paths
1075
oldpath_encoded = get_encoded_path(paths[0])
1076
newpath_encoded = get_encoded_path(paths[1])
1077
old_present = (kind[0] is not None and versioned[0])
1078
new_present = (kind[1] is not None and versioned[1])
1079
renamed = (parent[0], name[0]) != (parent[1], name[1])
1073
oldpath, newpath = change.path
1074
oldpath_encoded = get_encoded_path(change.path[0])
1075
newpath_encoded = get_encoded_path(change.path[1])
1076
old_present = (change.kind[0] is not None and change.versioned[0])
1077
new_present = (change.kind[1] is not None and change.versioned[1])
1078
executable = change.executable
1080
renamed = (change.parent_id[0], change.name[0]) != (change.parent_id[1], change.name[1])
1081
1082
properties_changed = []
1082
1083
properties_changed.extend(
1104
1105
# modified *somehow*, either content or execute bit.
1105
1106
self.to_file.write(b"=== modified %s '%s'%s\n" % (kind[0].encode('ascii'),
1106
1107
newpath_encoded, prop_str))
1108
if change.changed_content:
1108
1109
self._diff(oldpath, newpath, kind[0], kind[1])
1109
1110
has_changes = 1