ruby-changes:44582
From: nobu <ko1@a...>
Date: Mon, 7 Nov 2016 11:54:34 +0900 (JST)
Subject: [ruby-changes:44582] nobu:r56655 (trunk): vcs.rb: unnecessary arguments
nobu 2016-11-07 11:54:28 +0900 (Mon, 07 Nov 2016) New Revision: 56655 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56655 Log: vcs.rb: unnecessary arguments * tool/make-snapshot: $srcdir is optional. * tool/vcs.rb (export_changelog): remove unnecessary arguments. VCS should know srcdir and url. Modified files: trunk/tool/make-snapshot trunk/tool/vcs.rb Index: tool/make-snapshot =================================================================== --- tool/make-snapshot (revision 56654) +++ tool/make-snapshot (revision 56655) @@ -205,7 +205,6 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L205 end end - srcdir = File.realpath($srcdir) Dir.chdir(tmp) if tmp if !File.directory?(v) @@ -221,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(srcdir, url, $1.to_i+1, revision.to_i, "#{v}/ChangeLog") + vcs.export_changelog($1.to_i+1, revision.to_i, "#{v}/ChangeLog") end open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision}"} Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 56654) +++ tool/vcs.rb (revision 56655) @@ -117,6 +117,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L117 def initialize(path) @srcdir = path + @abs_srcdir = File.realpath(path) super() end @@ -304,7 +305,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L305 FileUtils.rm_rf(dir+"/.svn") end - def export_changelog(srcdir, url, from, to, path) + def export_changelog(from, to, path) IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, %W"svn log -r#{to}:#{from} #{url}") do |r| open(path, 'w') do |w| @@ -388,16 +389,16 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L389 FileUtils.rm_rf("#{dir}/.git") end - def export_changelog(srcdir, url, from, to, path) + def export_changelog(from, to, path) from = IO.pread(%W"git log -n1 --format=format:%H" + ["--grep=^ *git-svn-id: .*@#{from} "], - :chdir => srcdir) + :chdir => @abs_srcdir) to &&= IO.pread(%W"git log -n1 --format=format:%H" + ["--grep=^ *git-svn-id: .*@#{to} "], - :chdir => srcdir) + :chdir => @abs_srcdir) IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, %W"git log --date=iso-local --topo-order #{from}..#{to}", - :chdir => srcdir) do |r| + :chdir => @abs_srcdir) do |r| open(path, 'w') do |w| IO.copy_stream(r, w) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/