summaryrefslogtreecommitdiff
path: root/tool/file2lastrev.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-15 12:55:11 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-15 12:55:11 +0000
commit77204d5391043a9026c8078d12d84389dbe525dd (patch)
tree010d2d0057e348b4f4e873e57de1cb786148f738 /tool/file2lastrev.rb
parent83724a77dd85d7b5428742e40c1fa74804765610 (diff)
* 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
Diffstat (limited to 'tool/file2lastrev.rb')
-rwxr-xr-xtool/file2lastrev.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index 27fa31c..1ce80c9 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