comparison lib/redmine/scm/adapters/mercurial_adapter.rb @ 11:e297bf495063 yuya

Update for Mercurial 1.5 (which _does_ close xml doc)
author Chris Cannam
date Wed, 25 Aug 2010 12:09:06 +0100
parents ed5f37ea0d06
children de76cd3e8c8e b859cc0c4fa1
comparison
equal deleted inserted replaced
10:2c10dc5f122d 11:e297bf495063
139 def each_revision(path=nil, identifier_from=nil, identifier_to=nil, options={}) 139 def each_revision(path=nil, identifier_from=nil, identifier_to=nil, options={})
140 hg_args = ['log', '--debug', '-C', '--style', self.class.template_path] 140 hg_args = ['log', '--debug', '-C', '--style', self.class.template_path]
141 hg_args << '-r' << "#{hgrev(identifier_from)}:#{hgrev(identifier_to)}" 141 hg_args << '-r' << "#{hgrev(identifier_from)}:#{hgrev(identifier_to)}"
142 hg_args << '--limit' << options[:limit] if options[:limit] 142 hg_args << '--limit' << options[:limit] if options[:limit]
143 hg_args << without_leading_slash(path) unless path.blank? 143 hg_args << without_leading_slash(path) unless path.blank?
144 doc = hg(*hg_args) { |io| REXML::Document.new(io.read.concat('</log>')) } 144 doc = hg(*hg_args) { |io| REXML::Document.new(io.read) }
145 # TODO: ??? HG doesn't close the XML Document... 145 # TODO: ??? HG doesn't close the XML Document...
146 146
147 doc.each_element('log/logentry') do |le| 147 doc.each_element('log/logentry') do |le|
148 cpalist = le.get_elements('paths/path-copied').map do |e| 148 cpalist = le.get_elements('paths/path-copied').map do |e|
149 [e.text, e.attributes['copyfrom-path']] 149 [e.text, e.attributes['copyfrom-path']]