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

* 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
This commit is contained in:
akr 2010-04-15 12:55:11 +00:00
parent 83724a77dd
commit 77204d5391
2 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Thu Apr 15 21:54:39 2010 Tanaka Akira <akr@fsij.org>
* tool/file2lastrev.rb: use backtick for ruby 1.8.
Thu Apr 15 21:13:29 2010 NARUSE, Yui <naruse@ruby-lang.org> Thu Apr 15 21:13:29 2010 NARUSE, Yui <naruse@ruby-lang.org>
* tool/file2lastrev.rb: this should run with ruby 1.8. * tool/file2lastrev.rb: this should run with ruby 1.8.

View file

@ -60,7 +60,19 @@ class VCS
register(".svn") register(".svn")
def self.get_revisions(path) 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, _ = info_xml.split(/revision="(\d+)"/)
[last, changed] [last, changed]
end end