summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-25 08:32:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-25 08:32:52 +0000
commit867d39855863e53c84bc528537202d981f812997 (patch)
tree1a8f96f540140b76dfb85d425b33c599d21f1112 /tool
parent87b03e8c3c85ecca2c22c03fa539e8ed2c95451d (diff)
ChangeLog compatibility [ci skip]
* tool/vcs.rb (VCS::GIT#export_changelog): improve the compatibility with svn-log. remained differences are: - in svn-log - accented characters, left/right single quotation marks, and non-break spaces are translated to ASCII characters - other non-ASCII characters are excoded as `{U+XXXX}` - in git-log - tabs are expanded - in git-log (intentional) - lines looking too indented are unindented - empty lines between headers and bodies are squeezed git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/vcs.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 128dfe592e..ca9c8964b5 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -480,10 +480,13 @@ class VCS
s.sub!(/^git-svn-id: .*@(\d+) .*\n+\z/, '')
rev = $1
s.gsub!(/^ {8}/, '') if /^(?! {8}|$)/ !~ s
+ s.sub!(/\n\n\z/, "\n")
if /\A(\d+)-(\d+)-(\d+)/ =~ time
date = Time.new($1.to_i, $2.to_i, $3.to_i).strftime("%a, %d %b %Y")
end
- w.puts "r#{rev} | #{author} | #{time} (#{date}) | #{s.count("\n")} lines\n\n"
+ lines = s.count("\n")
+ lines = "#{lines} line#{lines == 1 ? '' : 's'}"
+ w.puts "r#{rev} | #{author} | #{time} (#{date}) | #{lines}\n\n"
w.puts s, sep
end
end