1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vcs.rb: unnecessary arguments

* tool/make-snapshot: $srcdir is optional.

* tool/vcs.rb (export_changelog): remove unnecessary arguments.
  VCS should know srcdir and url.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-11-07 02:54:28 +00:00
parent 8b97d66913
commit 4201000a7c
2 changed files with 7 additions and 7 deletions

View file

@ -205,7 +205,6 @@ def package(vcs, rev, destdir, tmp = nil)
end end
end end
srcdir = File.realpath($srcdir)
Dir.chdir(tmp) if tmp Dir.chdir(tmp) if tmp
if !File.directory?(v) if !File.directory?(v)
@ -221,7 +220,7 @@ def package(vcs, rev, destdir, tmp = nil)
unless /\Ar(\d+) / =~ f.readline unless /\Ar(\d+) / =~ f.readline
abort "Cannot find revision from '#{last_ChangeLog}'" abort "Cannot find revision from '#{last_ChangeLog}'"
end 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 end
open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision}"} open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision}"}

View file

@ -117,6 +117,7 @@ class VCS
def initialize(path) def initialize(path)
@srcdir = path @srcdir = path
@abs_srcdir = File.realpath(path)
super() super()
end end
@ -304,7 +305,7 @@ class VCS
FileUtils.rm_rf(dir+"/.svn") FileUtils.rm_rf(dir+"/.svn")
end 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'}, IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
%W"svn log -r#{to}:#{from} #{url}") do |r| %W"svn log -r#{to}:#{from} #{url}") do |r|
open(path, 'w') do |w| open(path, 'w') do |w|
@ -388,16 +389,16 @@ class VCS
FileUtils.rm_rf("#{dir}/.git") FileUtils.rm_rf("#{dir}/.git")
end 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" + from = IO.pread(%W"git log -n1 --format=format:%H" +
["--grep=^ *git-svn-id: .*@#{from} "], ["--grep=^ *git-svn-id: .*@#{from} "],
:chdir => srcdir) :chdir => @abs_srcdir)
to &&= IO.pread(%W"git log -n1 --format=format:%H" + to &&= IO.pread(%W"git log -n1 --format=format:%H" +
["--grep=^ *git-svn-id: .*@#{to} "], ["--grep=^ *git-svn-id: .*@#{to} "],
:chdir => srcdir) :chdir => @abs_srcdir)
IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
%W"git log --date=iso-local --topo-order #{from}..#{to}", %W"git log --date=iso-local --topo-order #{from}..#{to}",
:chdir => srcdir) do |r| :chdir => @abs_srcdir) do |r|
open(path, 'w') do |w| open(path, 'w') do |w|
IO.copy_stream(r, w) IO.copy_stream(r, w)
end end