]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: fix exception operation in adapter all methods using xml and io.read...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 18 Feb 2011 14:49:31 +0000 (14:49 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 18 Feb 2011 14:49:31 +0000 (14:49 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4879 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/mercurial_adapter.rb

index 1f706946fdee84e486b51451fe0a738fbed2b27c..10aac326401fc93fff85d0beb28ee65a2c4dbbd1 100644 (file)
@@ -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|