ruby-changes:44583
From: nobu <ko1@a...>
Date: Mon, 7 Nov 2016 12:25:32 +0900 (JST)
Subject: [ruby-changes:44583] nobu:r56656 (trunk): vcs.rb: exclude beginning revision
nobu 2016-11-07 12:25:28 +0900 (Mon, 07 Nov 2016) New Revision: 56656 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56656 Log: vcs.rb: exclude beginning revision * tool/make-snapshot: pass the last revision in the last ChangeLog file without increment. * tool/vcs.rb (export_changelog): exclude the beginning revision of the range uniformly. svn log includes it, but git log not. Modified files: trunk/tool/make-snapshot trunk/tool/vcs.rb Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 56655) +++ tool/vcs.rb (revision 56656) @@ -306,8 +306,9 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L306 end def export_changelog(from, to, path) + range = [to, (from+1 if from)].compact.join(':') IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, - %W"svn log -r#{to}:#{from} #{url}") do |r| + %W"svn log -r#{range} #{url}") do |r| open(path, 'w') do |w| IO.copy_stream(r, w) end @@ -390,14 +391,16 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L391 end def export_changelog(from, to, path) - from = IO.pread(%W"git log -n1 --format=format:%H" + - ["--grep=^ *git-svn-id: .*@#{from} "], - :chdir => @abs_srcdir) - to &&= IO.pread(%W"git log -n1 --format=format:%H" + - ["--grep=^ *git-svn-id: .*@#{to} "], - :chdir => @abs_srcdir) + range = [from, to].map do |rev| + rev or next + rev = IO.pread({'LANG' => 'C', 'LC_ALL' => 'C'}, + %W"git log -n1 --format=format:%H" << + "--grep=^ *git-svn-id: .*@#{rev} ", + :chdir => @abs_srcdir) + rev unless rev.empty? + end.join('..') IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, - %W"git log --date=iso-local --topo-order #{from}..#{to}", + %W"git svn log --date=iso-local --topo-order #{range}", :chdir => @abs_srcdir) do |r| open(path, 'w') do |w| IO.copy_stream(r, w) Index: tool/make-snapshot =================================================================== --- tool/make-snapshot (revision 56655) +++ tool/make-snapshot (revision 56656) @@ -220,7 +220,7 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L220 unless /\Ar(\d+) / =~ f.readline abort "Cannot find revision from '#{last_ChangeLog}'" end - vcs.export_changelog($1.to_i+1, revision.to_i, "#{v}/ChangeLog") + vcs.export_changelog($1.to_i, revision.to_i, "#{v}/ChangeLog") end open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision}"} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/