comparison lib/redmine/scm/adapters/mercurial_adapter.rb @ 6:ed5f37ea0d06 yuya

* Clumsy fix for Mercurial <1.5 failure to support footer for </log>
author Chris Cannam
date Wed, 28 Jul 2010 12:58:13 +0100
parents 7c48bad7d85d
children e297bf495063
comparison
equal deleted inserted replaced
5:93b07183b4a9 6:ed5f37ea0d06
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) } 144 doc = hg(*hg_args) { |io| REXML::Document.new(io.read.concat('</log>')) }
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']]