[前][次][番号順一覧][スレッド一覧]

ruby-changes:53753

From: nobu <ko1@a...>
Date: Sun, 25 Nov 2018 17:32:55 +0900 (JST)
Subject: [ruby-changes:53753] nobu:r65970 (trunk): ChangeLog compatibility [ci skip]

nobu	2018-11-25 17:32:52 +0900 (Sun, 25 Nov 2018)

  New Revision: 65970

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65970

  Log:
    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

  Modified files:
    trunk/tool/vcs.rb
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 65969)
+++ tool/vcs.rb	(revision 65970)
@@ -480,10 +480,13 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L480
             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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]