Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection of already generated version is not working #29

Open
adiroiban opened this issue Jan 10, 2016 · 2 comments
Open

Detection of already generated version is not working #29

adiroiban opened this issue Jan 10, 2016 · 2 comments
Labels

Comments

@adiroiban
Copy link
Member

.... after the update for TOWNCRIER_START

maybe it should only look for version number, and not include the date in the search pattern

a quick fix

--- a/src/towncrier/_writer.py
+++ b/src/towncrier/_writer.py
@@ -24,19 +24,19 @@ def append_to_newsfile(directory, filename, name_and_version, content):
         with open(news_file, "r") as f:
             existing_content = f.read()

-    existing_content = existing_content.split(TOWNCRIER_START)
-
-    top_line = name_and_version + "\n" + "=" * len(name_and_version) + "\n\n"
+    top_line = name_and_version + "\n" + "-" * len(name_and_version) + "\n\n"

     if top_line in existing_content:
         raise ValueError(
             "It seems you've already produced newsfiles for this version?")

+    existing_content = existing_content.split(TOWNCRIER_START)
+
@adiroiban
Copy link
Member Author

Here is another patch chevah@7dcad20

with the introduction of start_line (start_string ... the names are confusing) the search is done in the wrong place

@altendky altendky added the bug label Nov 26, 2020
@adiroiban
Copy link
Member Author

As this was created in 2016 I have just retested with a newer version.
This is still a bug.

To reproduce, make sure that trunk branch has at least one newsfragment
the run multiple times $ echo n | towncrier build

It should only work for the first time and then fail on subsequent calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants