summaryrefslogtreecommitdiff
path: root/tool/lib/vcs.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-10-03 22:02:02 +0900
committerNobuyoshi Nakada <[email protected]>2023-10-03 22:02:02 +0900
commit10379ebf90acd9622e4fccd9d4386ab3a69f4e9c ()
tree6368cb6253b8c201611f8a9ceeef529695002c9b /tool/lib/vcs.rb
parented0661e618fa9fe9e685f755f02e3a1de2d4726b (diff)
Support regexp in log-fix [ci skip]
-rw-r--r--tool/lib/vcs.rb25
1 files changed, 22 insertions, 3 deletions
@@ -707,12 +707,31 @@ class VCS
range = b..b
end
case x
- when %r[^s([#{LOG_FIX_REGEXP_SEPARATORS}])(.+)\1(.*)\1]o
wrong = $2
correct = $3
range.each do |n|
- s[n][wrong] = correct
- rescue IndexError
message = ["format_changelog failed to replace #{wrong.dump} with #{correct.dump} at #{n}\n"]
from = [1, n-2].max
to = [s.size-1, n+2].min