diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-18 12:44:43 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-18 12:44:43 +0000 |
commit | 190d288381795fe6d527eb66f0eec852c48663f2 (patch) | |
tree | d89118d04d6bef409662a40a2983be902cbafe9d /lib/redmine/scm/adapters/mercurial_adapter.rb | |
parent | 0833abd9e57940f476f12b13ad9393aa4526c51b (diff) | |
download | redmine-190d288381795fe6d527eb66f0eec852c48663f2.tar.gz redmine-190d288381795fe6d527eb66f0eec852c48663f2.zip |
scm: mercurial: fix exception operation in adapter "summary" method (#4455).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4876 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm/adapters/mercurial_adapter.rb')
-rw-r--r-- | lib/redmine/scm/adapters/mercurial_adapter.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index 6903f80cf..80ad02f58 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -110,9 +110,16 @@ module Redmine end def summary - @summary ||= hg 'rhsummary' do |io| - ActiveSupport::XmlMini.parse(io.read)['rhsummary'] + return @summary if @summary + doc = nil + hg 'rhsummary' do |io| + output = io.read + begin + doc = ActiveSupport::XmlMini.parse(output)['rhsummary'] + rescue + end end + @summary = doc end private :summary |