commit 21f171e1f8af7e222a87523d7957174f985a1dd5 Author: Jonathan Wakely Date: Mon Jun 1 18:33:48 2020 +0100 gcc-changelog: Allow "doc/html/*" in libstdc++ changelog contrib/ChangeLog: * gcc-changelog/git_commit.py (check_mentioned_files): Allow wildcard path for generated files in libstdc++-v3/doc/html. * gcc-changelog/test_email.py (test_libstdcxx_html_regenerated): New test. * gcc-changelog/test_patches.txt: Add patches. diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index b8c7f718c50..d723d890f31 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -501,6 +501,7 @@ class GitCommit: assert folder_count == len(self.changelog_entries) mentioned_files = set() + libstdcxx_html_regenerated = False for entry in self.changelog_entries: if not entry.files: msg = 'ChangeLog must contain at least one file entry' @@ -508,16 +509,33 @@ class GitCommit: assert not entry.folder.endswith('/') for file in entry.files: if not self.is_changelog_filename(file): - mentioned_files.add(os.path.join(entry.folder, file)) + file = os.path.join(entry.folder, file) + if file == 'libstdc++-v3/doc/html/*': + libstdcxx_html_regenerated = True + else: + mentioned_files.add(file) cand = [x[0] for x in self.modified_files if not self.is_changelog_filename(x[0])] changed_files = set(cand) + if libstdcxx_html_regenerated: + libstdcxx_html_regenerated = False + for c in changed_files: + if c.startswith('libstdc++-v3/doc/html/'): + libstdcxx_html_regenerated = True + break + if not libstdcxx_html_regenerated: + self.errors.append(Error('No libstdc++ HTML changes found')) + for file in sorted(mentioned_files - changed_files): self.errors.append(Error('file not changed in a patch', file)) for file in sorted(changed_files - mentioned_files): if not self.in_ignored_location(file): - if file in self.new_files: + if file.startswith('libstdc++-v3/doc/html/'): + if not libstdcxx_html_regenerated: + msg = 'libstdc++ HTML changes not in ChangeLog' + self.errors.append(Error(msg, file)) + elif file in self.new_files: changelog_location = self.get_changelog_by_path(file) # Python2: we cannot use next(filter(...)) entries = filter(lambda x: x.folder == changelog_location, diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py index 2465669786e..3f4bc9dffd0 100755 --- a/contrib/gcc-changelog/test_email.py +++ b/contrib/gcc-changelog/test_email.py @@ -318,3 +318,14 @@ class TestGccChangelog(unittest.TestCase): assert len(email.errors) == 2 assert email.errors[0].message == 'missing description of a change' assert email.errors[1].message == 'missing description of a change' + + def test_libstdcxx_html_regenerated(self): + email = self.from_patch_glob('0001-Fix-text-of-hyperlink-in-manual') + assert not email.errors + email = self.from_patch_glob('0002-libstdc-Fake-test-change-1.patch') + assert len(email.errors) == 1 + assert email.errors[0].message == 'No libstdc++ HTML changes found' + email = self.from_patch_glob('0003-libstdc-Fake-test-change-2.patch') + assert len(email.errors) == 1 + msg = 'libstdc++ HTML changes not in ChangeLog' + assert email.errors[0].message == msg diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt index 25311fbf300..2c308f6477c 100644 --- a/contrib/gcc-changelog/test_patches.txt +++ b/contrib/gcc-changelog/test_patches.txt @@ -2973,3 +2973,127 @@ index 1cd5872c03d..6f95aedb3d3 100644 + -- 2.26.2 + +=== 0001-Fix-text-of-hyperlink-in-manual.patch === +From c7904d9e08a0ca3f733be3c2e8a3b912fa851fc5 Mon Sep 17 00:00:00 2001 +From: Jonathan Wakely +Date: Fri, 8 Mar 2019 13:56:53 +0000 +Subject: [PATCH] Fix text of hyperlink in manual + + * doc/xml/manual/using.xml: Use link element instead of xref. + * doc/html/*: Regenerate. + +--- + libstdc++-v3/ChangeLog | 3 +++ + libstdc++-v3/doc/html/manual/using_macros.html | 3 ++- + libstdc++-v3/doc/xml/manual/using.xml | 4 ++-- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog +index e752285bdb2..7da25945a8c 100644 +--- a/libstdc++-v3/ChangeLog ++++ b/libstdc++-v3/ChangeLog +@@ -1,5 +1,8 @@ + 2019-03-08 Jonathan Wakely + ++ * doc/xml/manual/using.xml: Use link element instead of xref. ++ * doc/html/*: Regenerate. ++ + * include/bits/fs_path.h (path::format): Add fixed underlying type. + + 2019-03-08 François Dumont +diff --git a/libstdc++-v3/doc/html/manual/using_macros.html b/libstdc++-v3/doc/html/manual/using_macros.html +index 7030bd2d0fd..dad6564a97d 100644 +--- a/libstdc++-v3/doc/html/manual/using_macros.html ++++ b/libstdc++-v3/doc/html/manual/using_macros.html +@@ -116,7 +116,8 @@ + enabled for + std::vector<T, std::allocator<T>> + and only when std::allocator is derived from +- the section called “Implementation”. The annotations ++ new_allocator ++ or malloc_allocator. The annotations + must be present on all vector operations or none, so this macro must + be defined to the same value for all translation units that create, + destroy or modify vectors. +diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml +index 2d44a739406..7647e9b8dad 100644 +--- a/libstdc++-v3/doc/xml/manual/using.xml ++++ b/libstdc++-v3/doc/xml/manual/using.xml +@@ -1192,8 +1192,8 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe + enabled for + std::vector<T, std::allocator<T>> + and only when std::allocator is derived from +- new_allocator +- or malloc_allocator. The annotations ++ new_allocator ++ or malloc_allocator. The annotations + must be present on all vector operations or none, so this macro must + be defined to the same value for all translation units that create, + destroy or modify vectors. +-- +2.25.4 + +=== 0002-libstdc-Fake-test-change-1.patch === +From fe4ade6778d1d97214db12bf2c40d0f40e7f953a Mon Sep 17 00:00:00 2001 +From: Jonathan Wakely +Date: Tue, 2 Jun 2020 11:52:34 +0100 +Subject: [PATCH] libstdc++: Fake change for testing git_commit.py + +libstdc++-v3/ChangeLog: + + * doc/xml/faq.xml: Fake change. + * doc/html/*: Regenerated. +--- + libstdc++-v3/doc/xml/faq.xml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml +index e419d3c22a0..bcc14dd6d90 100644 +--- a/libstdc++-v3/doc/xml/faq.xml ++++ b/libstdc++-v3/doc/xml/faq.xml +@@ -1315,3 +1315,4 @@ + + + ++fake change +-- +2.25.4 + +=== 0003-libstdc-Fake-test-change-2.patch === +From e460effb3a42c1c046b682fe266da418f2693ef3 Mon Sep 17 00:00:00 2001 +From: Jonathan Wakely +Date: Tue, 2 Jun 2020 11:52:34 +0100 +Subject: [PATCH] libstdc++: Fake change for testing 2 + +libstdc++-v3/ChangeLog: + + * doc/xml/faq.xml: Fake change. +--- + libstdc++-v3/doc/html/faq.html | 2 +- + libstdc++-v3/doc/xml/faq.xml | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html +index 967e5f5f348..95d21b5bf9f 100644 +--- a/libstdc++-v3/doc/html/faq.html ++++ b/libstdc++-v3/doc/html/faq.html +@@ -910,4 +910,4 @@ +

+ See Shrink-to-fit + strings for a similar solution for strings. +-

+\ No newline at end of file ++

fake change +diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml +index e419d3c22a0..bcc14dd6d90 100644 +--- a/libstdc++-v3/doc/xml/faq.xml ++++ b/libstdc++-v3/doc/xml/faq.xml +@@ -1315,3 +1315,4 @@ + + + ++fake change +-- +2.25.4 +