Redmine の Darcs の io.gets

Defect #6860: svn: Write error: Broken pipe when browsing repository - Redmine
の話なのだが、ついでだからDarcsもやってみた。

$ LANG=C RAILS_ENV=test ruby script/console
Loading test environment (Rails 2.3.5)
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
>> v = Redmine::Scm::Adapters::SubversionAdapter.client_version
=> [1, 6, 13]
>> v = Redmine::Scm::Adapters::DarcsAdapter.client_version
=> [2, 2, 1]

あれ?

http://www.redmine.org/projects/redmine/repository/entry/tags/1.0.3/lib/redmine/scm/adapters/darcs_adapter.rb#L38

diff --git a/lib/redmine/scm/adapters/darcs_adapter.rb b/lib/redmine/scm/adapters/darcs_adapter.rb
--- a/lib/redmine/scm/adapters/darcs_adapter.rb
+++ b/lib/redmine/scm/adapters/darcs_adapter.rb
@@ -35,7 +35,7 @@ module Redmine
             version = nil
             shellout(cmd) do |io|
               # Read darcs version in first returned line
-              if m = io.gets.match(%r{((\d+\.)+\d+)})
+              if m = io.gets.to_s.match(%r{((\d+\.)+\d+)})
                 version = m[0].scan(%r{\d+}).collect(&:to_i)
               end
             end

変わらないね・・・

$ darcs --version
2.2.1 (release)
$ LC_ALL=C rpm -qi darcs
Name        : darcs                        Relocations: (not relocatable)
Version     : 2.2.1                             Vendor: Fedora Project
Release     : 5.fc12                        Build Date: Sun Sep 13 01:22:23 2009
Install Date: Mon Sep 20 18:35:12 2010         Build Host: x86-4.fedora.phx.redhat.com
Group       : Development/Tools             Source RPM: darcs-2.2.1-5.fc12.src.rpm
Size        : 4410379                          License: GPLv2+
Signature   : RSA/8, Thu Oct  1 10:06:49 2009, Key ID 9d1cc34857bbccba
Packager    : Fedora Project
URL         : http://www.darcs.net/
Summary     : David's advanced revision control system
Description :
Darcs is a revision control system, along the lines of CVS
or arch. That means that it keeps track of various revisions
and branches of your project, allows for changes to
propagate from one branch to another. Darcs is intended to
be an ``advanced'' revision control system. Darcs has two
particularly distinctive features which differ from other
revision control systems: 1) each copy of the source is a
fully functional branch, and 2) underlying darcs is a
consistent and powerful theory of patches.