From 77204d5391043a9026c8078d12d84389dbe525dd Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 15 Apr 2010 12:55:11 +0000 Subject: * tool/file2lastrev.rb: use backtick for ruby 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/file2lastrev.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tool') diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb index 27fa31c3af..1ce80c9032 100755 --- a/tool/file2lastrev.rb +++ b/tool/file2lastrev.rb @@ -60,7 +60,19 @@ class VCS register(".svn") def self.get_revisions(path) - info_xml = IO.popen(["svn", "info", "--xml", path.to_s, {:err=>[:child, :out]}]) {|f| f.read } + begin + nulldevice = '/dev/null' + if File.exist? nulldevice + save_stderr = STDERR.dup + STDERR.reopen nulldevice, 'w' + end + info_xml = `svn info --xml "#{path}"` + ensure + if save_stderr + STDERR.reopen save_stderr + save_stderr.close + end + end _, last, _, changed, _ = info_xml.split(/revision="(\d+)"/) [last, changed] end -- cgit v1.2.1