diff --git a/ChangeLog b/ChangeLog index 681bf2165a..d89933fc4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 15 21:54:39 2010 Tanaka Akira + + * tool/file2lastrev.rb: use backtick for ruby 1.8. + Thu Apr 15 21:13:29 2010 NARUSE, Yui * tool/file2lastrev.rb: this should run with ruby 1.8. 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