]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use commit timestamp in git_update_version.py.
authorMartin Liska <mliska@suse.cz>
Tue, 19 May 2020 19:16:10 +0000 (21:16 +0200)
committerMartin Liska <mliska@suse.cz>
Tue, 19 May 2020 19:17:09 +0000 (21:17 +0200)
* gcc-changelog/git_commit.py: Add param use_commit_ts
for to_changelog_entries.
* gcc-changelog/git_update_version.py: Se use_commit_ts to True.

contrib/ChangeLog
contrib/gcc-changelog/git_commit.py
contrib/gcc-changelog/git_update_version.py

index 5ef08f41a92e7b32c697a51165cf6b8db6b31f08..f3de87b43d9f283cf90ef35eda010a601fbc3b62 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-19  Martin Liska  <mliska@suse.cz>
+
+       * gcc-changelog/git_commit.py: Add param use_commit_ts
+       for to_changelog_entries.
+       * gcc-changelog/git_update_version.py: Se use_commit_ts to True.
+
 2020-05-19  Martin Liska  <mliska@suse.cz>
 
        * mklog.py: Skip GTY for struct names.  Make flake8 happy.
index 5214cc365382c139e5219e03f8c8d19b868ad239..f6b9c5b15869db3d3c10c78527023c9b7e63e8a1 100755 (executable)
@@ -500,11 +500,11 @@ class GitCommit:
                     err = Error(msg % (entry.folder, changelog_location), file)
                     self.errors.append(err)
 
-    def to_changelog_entries(self):
+    def to_changelog_entries(self, use_commit_ts=False):
         for entry in self.changelog_entries:
             output = ''
             timestamp = entry.datetime
-            if not timestamp:
+            if not timestamp or use_commit_ts:
                 timestamp = self.date.strftime('%Y-%m-%d')
             authors = entry.authors if entry.authors else [self.author]
             # add Co-Authored-By authors to all ChangeLog entries
index 2de44f275801b1eefff7f709c104a66b81d3719d..f38e011df459e7f39c02611ade4ab83df85fa027 100755 (executable)
@@ -38,7 +38,7 @@ def prepend_to_changelog_files(repo, folder, git_commit):
             print(error)
         # TODO: add error message
         return
-    for entry, output in git_commit.to_changelog_entries():
+    for entry, output in git_commit.to_changelog_entries(use_commit_ts=True):
         # TODO
         full_path = os.path.join(folder, entry, 'ChangeLog.test')
         print('writting to %s' % full_path)