diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-18 14:49:31 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-18 14:49:31 +0000 |
commit | c6e1d4f39db3f221a7198a545e172b94cf7b5be1 (patch) | |
tree | 294f8efb926be048febc2723d9ddcbdfb4eafcf5 /lib/redmine/scm/adapters/mercurial_adapter.rb | |
parent | 96f82be2f437793437b3925970aa9be1fe693b9a (diff) | |
download | redmine-c6e1d4f39db3f221a7198a545e172b94cf7b5be1.tar.gz redmine-c6e1d4f39db3f221a7198a545e172b94cf7b5be1.zip |
scm: mercurial: fix exception operation in adapter all methods using xml and io.read (#4455).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4879 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 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index 1f706946f..10aac3264 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -124,7 +124,10 @@ module Redmine def entries(path=nil, identifier=nil) manifest = hg('rhmanifest', '-r', hgrev(identifier), CGI.escape(without_leading_slash(path.to_s))) do |io| - ActiveSupport::XmlMini.parse(io.read)['rhmanifest']['repository']['manifest'] + begin + ActiveSupport::XmlMini.parse(io.read)['rhmanifest']['repository']['manifest'] + rescue + end end path_prefix = path.blank? ? '' : with_trailling_slash(path) @@ -164,8 +167,11 @@ module Redmine hg_args << '--limit' << options[:limit] if options[:limit] hg_args << hgtarget(path) unless path.blank? log = hg(*hg_args) do |io| - # Mercurial < 1.5 does not support footer template for '</log>' - ActiveSupport::XmlMini.parse("#{io.read}</log>")['log'] + begin + # Mercurial < 1.5 does not support footer template for '</log>' + ActiveSupport::XmlMini.parse("#{io.read}</log>")['log'] + rescue + end end as_ary(log['logentry']).each do |le| |