mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
87b03e8c3c
commit
867d398558
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue