mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vcs.rb: use chdir option
* tool/vcs.rb (export_changelog): for old git, use chdir option instead of git -C option, and set language environmets to C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2a8ba4bd64
commit
8b97d66913
1 changed files with 21 additions and 4 deletions
25
tool/vcs.rb
25
tool/vcs.rb
|
@ -77,6 +77,16 @@ if RUBY_VERSION < "2.0"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
module DebugPOpen
|
||||||
|
refine IO.singleton_class do
|
||||||
|
def popen(*args)
|
||||||
|
STDERR.puts args.inspect if $DEBUG
|
||||||
|
super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
using DebugPOpen
|
||||||
end
|
end
|
||||||
|
|
||||||
class VCS
|
class VCS
|
||||||
|
@ -295,7 +305,8 @@ class VCS
|
||||||
end
|
end
|
||||||
|
|
||||||
def export_changelog(srcdir, url, from, to, path)
|
def export_changelog(srcdir, url, from, to, path)
|
||||||
IO.popen({'TZ' => 'JST-9'}, "svn log -r#{to}:#{from} #{url}") do |r|
|
IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
|
||||||
|
%W"svn log -r#{to}:#{from} #{url}") do |r|
|
||||||
open(path, 'w') do |w|
|
open(path, 'w') do |w|
|
||||||
IO.copy_stream(r, w)
|
IO.copy_stream(r, w)
|
||||||
end
|
end
|
||||||
|
@ -378,9 +389,15 @@ class VCS
|
||||||
end
|
end
|
||||||
|
|
||||||
def export_changelog(srcdir, url, from, to, path)
|
def export_changelog(srcdir, url, from, to, path)
|
||||||
from = `git -C #{srcdir} log -n1 --format=format:%H --grep='^ *git-svn-id: .*@#{from} '`
|
from = IO.pread(%W"git log -n1 --format=format:%H" +
|
||||||
to = `git -C #{srcdir} log -n1 --format=format:%H --grep='^ *git-svn-id: .*@#{to} '`
|
["--grep=^ *git-svn-id: .*@#{from} "],
|
||||||
IO.popen({'TZ' => 'JST-9'}, "git -C #{srcdir} log --date=iso-local --topo-order #{from}..#{to}") do |r|
|
:chdir => srcdir)
|
||||||
|
to &&= IO.pread(%W"git log -n1 --format=format:%H" +
|
||||||
|
["--grep=^ *git-svn-id: .*@#{to} "],
|
||||||
|
:chdir => 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|
|
||||||
open(path, 'w') do |w|
|
open(path, 'w') do |w|
|
||||||
IO.copy_stream(r, w)
|
IO.copy_stream(r, w)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue