aboutsummaryrefslogtreecommitdiff
path: root/contrib/mklog.py
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-05-27 20:03:50 +0200
committerMartin Liska <mliska@suse.cz>2020-05-28 10:27:09 +0200
commiteb78da45ab82753b78bf062c6f3e982f68274913 (patch)
tree4403f656a3ec732534de3a6186b94fa823b466f7 /contrib/mklog.py
parent4a948703db483c3ba3df67816425d951c0268623 (diff)
downloadgcc-eb78da45ab82753b78bf062c6f3e982f68274913.zip
gcc-eb78da45ab82753b78bf062c6f3e982f68274913.tar.gz
gcc-eb78da45ab82753b78bf062c6f3e982f68274913.tar.bz2
mklog: support renaming of files
contrib/ChangeLog: * mklog.py: Support renaming of files. One needs unidiff 0.6.0+. * test_mklog.py: Test it.
Diffstat (limited to 'contrib/mklog.py')
-rwxr-xr-xcontrib/mklog.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/mklog.py b/contrib/mklog.py
index fb58661..243edbb 100755
--- a/contrib/mklog.py
+++ b/contrib/mklog.py
@@ -173,6 +173,14 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False):
out += '\t* %s: %s.\n' % (relative_path, msg)
elif file.is_removed_file:
out += '\t* %s: Removed.\n' % (relative_path)
+ elif hasattr(file, 'is_rename') and file.is_rename:
+ out += '\t* %s: Moved to...\n' % (relative_path)
+ new_path = file.target_file[2:]
+ # A file can be theoretically moved to a location that
+ # belongs to a different ChangeLog. Let user fix it.
+ if new_path.startswith(changelog):
+ new_path = new_path[len(changelog):].lstrip('/')
+ out += '\t* %s: ...here.\n' % (new_path)
else:
if not no_functions:
for hunk in file: