gcc-changelog: fix Backported from timestamp.
authorMartin Liska <mliska@suse.cz>
Thu, 18 Jun 2020 08:05:40 +0000 (10:05 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 18 Jun 2020 08:07:59 +0000 (10:07 +0200)
contrib/ChangeLog:

* gcc-changelog/git_commit.py: Fix Backported from timestamp when
use_commit_ts=True is used.

contrib/gcc-changelog/git_commit.py

index ab9fdbd52fd7f94a312a8c244906c205ca1c51c7..4a78793b87e8eb45e32d632d64caf31802bff1f8 100755 (executable)
@@ -615,9 +615,13 @@ class GitCommit:
             timestamp = entry.datetime
             if self.cherry_pick_commit:
                 timestamp = self.commit_to_date_hook(self.cherry_pick_commit)
+                # it can happen that it is a cherry-pick for a different
+                # repository
                 if timestamp:
                     timestamp = timestamp.strftime(DATE_FORMAT)
-            if not timestamp or use_commit_ts:
+                else:
+                    timestamp = current_timestamp
+            elif not timestamp or use_commit_ts:
                 timestamp = current_timestamp
             authors = entry.authors if entry.authors else [self.author]
             # add Co-Authored-By authors to all ChangeLog entries