From c38f679eebffd601d977330f24def69f4b620c93 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 22 Mar 2021 10:53:57 +0100 Subject: [PATCH] mklog: add new argument --directory. The argument is handy when one needs to generate ChangeLog entries for a different project (e.g. binutils). contrib/ChangeLog: * mklog.py: Add --directory argument. --- contrib/mklog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/mklog.py b/contrib/mklog.py index 6509886741d..00a001ec5ae 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -71,7 +71,7 @@ gcc_root = os.path.dirname(os.path.dirname(script_folder)) def find_changelog(path): folder = os.path.split(path)[0] while True: - if os.path.exists(os.path.join(gcc_root, folder, 'ChangeLog')): + if os.path.exists(os.path.join(args.directory, folder, 'ChangeLog')): return folder folder = os.path.dirname(folder) if folder == '': @@ -277,6 +277,9 @@ if __name__ == '__main__': help='Do not generate function names in ChangeLogs') parser.add_argument('-p', '--fill-up-bug-titles', action='store_true', help='Download title of mentioned PRs') + parser.add_argument('-d', '--directory', default=gcc_root, + help='Root directory where to search for ChangeLog ' + 'files') parser.add_argument('-c', '--changelog', help='Append the ChangeLog to a git commit message ' 'file')