mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
chore: allow unreleased-lines to be reused on other files (#5593)
This commit is contained in:
parent
694cc2dbff
commit
2d8937f43e
|
@ -16,18 +16,20 @@ LINE_REGEX = re.compile(
|
||||||
)
|
)
|
||||||
VERSION_REGEX = re.compile(r"^#+\s*v?\d")
|
VERSION_REGEX = re.compile(r"^#+\s*v?\d")
|
||||||
|
|
||||||
# contains lines in the form of
|
|
||||||
# {commit-sha} (<{email}>\s+{date}\s+{line-no}) {line}
|
def get_unreleased_lines(file: str):
|
||||||
p = subprocess.run(
|
# contains lines in the form of
|
||||||
["git", "blame", "-e", "--date=iso", "../CHANGELOG.md"],
|
# {commit-sha} (<{email}>\s+{date}\s+{line-no}) {line}
|
||||||
|
p = subprocess.run(
|
||||||
|
["git", "blame", "-e", "--date=iso", file],
|
||||||
cwd=os.path.dirname(os.path.realpath(__file__)),
|
cwd=os.path.dirname(os.path.realpath(__file__)),
|
||||||
text=True,
|
text=True,
|
||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
unreleased_lines: list[tuple[datetime, str]] = []
|
unreleased_lines: list[tuple[datetime, str]] = []
|
||||||
for line in p.stdout.splitlines():
|
for line in p.stdout.splitlines():
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
m = LINE_REGEX.match(line)
|
m = LINE_REGEX.match(line)
|
||||||
|
@ -46,7 +48,11 @@ for line in p.stdout.splitlines():
|
||||||
content = content.replace("- ", f"- [{d.strftime('%Y-%m-%d')}] ", 1)
|
content = content.replace("- ", f"- [{d.strftime('%Y-%m-%d')}] ", 1)
|
||||||
unreleased_lines.append((d, content))
|
unreleased_lines.append((d, content))
|
||||||
|
|
||||||
unreleased_lines.sort(key=lambda it: it[0], reverse=True)
|
unreleased_lines.sort(key=lambda it: it[0], reverse=True)
|
||||||
|
return unreleased_lines
|
||||||
|
|
||||||
|
|
||||||
|
unreleased_lines = get_unreleased_lines("../CHANGELOG.md")
|
||||||
|
|
||||||
if len(unreleased_lines) == 0:
|
if len(unreleased_lines) == 0:
|
||||||
print("No changes since last release.")
|
print("No changes since last release.")
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
- Dev: Moved some responsibility away from Application into WindowManager. (#5551)
|
- Dev: Moved some responsibility away from Application into WindowManager. (#5551)
|
||||||
- Dev: Fixed benchmarks segfaulting on run. (#5559)
|
- Dev: Fixed benchmarks segfaulting on run. (#5559)
|
||||||
- Dev: Refactored `MessageBuilder` to be a single class. (#5548)
|
- Dev: Refactored `MessageBuilder` to be a single class. (#5548)
|
||||||
- Dev: Recent changes are now shown in the nightly release description. (#5553, #5554)
|
- Dev: Recent changes are now shown in the nightly release description. (#5553, #5554, #5593)
|
||||||
- Dev: The timer for `StreamerMode` is now destroyed on the correct thread. (#5571)
|
- Dev: The timer for `StreamerMode` is now destroyed on the correct thread. (#5571)
|
||||||
- Dev: Cleanup some parts of the `magic_enum` adaptation for Qt. (#5587)
|
- Dev: Cleanup some parts of the `magic_enum` adaptation for Qt. (#5587)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue