texlive[71604] Build/source/texk/web2c/tests/fix-changefile-lines.py:
commits+ascherer at tug.org
commits+ascherer at tug.org
Sun Jun 23 23:17:06 CEST 2024
Revision: 71604
https://tug.org/svn/texlive?view=revision&revision=71604
Author: ascherer
Date: 2024-06-23 23:17:06 +0200 (Sun, 23 Jun 2024)
Log Message:
-----------
Optionally replace optional tags.
Now we can update changefiles that only have 'l.NNN' line numbers,
without duplicating these (as part of the 'text').
Modified Paths:
--------------
trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py
Modified: trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py
===================================================================
--- trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py 2024-06-23 20:57:17 UTC (rev 71603)
+++ trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py 2024-06-23 21:17:06 UTC (rev 71604)
@@ -193,20 +193,23 @@
# Remove leading @x.
text = self._lines[self._chunk_start][2:].strip()
- # Remove potentially leading [part.section] tag.
- pattern = "\\[\\d+(\\.\\d+)?\\]"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1).strip()
+ if opt_handler.part_b or opt_handler.section_b:
+ # Remove potentially leading [part.section] tag.
+ pattern = "\\[\\d+(\\.\\d+)?\\]"
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text, 1).strip()
+ if opt_handler.line_b:
# Remove potentially line number information.
pattern = "l\\.\\d+"
if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1)
+ text = re.sub(pattern, "", text, 1).strip()
- # Remove potentially text comment separator.
- pattern = " -*"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1).strip()
+ if opt_handler.hyphen_b:
+ # Remove potentially text comment separator.
+ pattern = "-+"
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text, 1).strip()
# Create line with standard tag and optional information.
new_line = "@x"
More information about the tex-live-commits
mailing list.