comparison lib/redmine/scm/adapters/mercurial_adapter.rb @ 1115:433d4f72a19b redmine-2.2

Update to Redmine SVN revision 11137 on 2.2-stable branch
author Chris Cannam
date Mon, 07 Jan 2013 12:01:42 +0000
parents cbb26bc654de
children bb32da3bea34 622f24f53b42
comparison
equal deleted inserted replaced
929:5f33065ddc4b 1115:433d4f72a19b
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
133 output = io.read 133 output = io.read
134 if output.respond_to?(:force_encoding) 134 if output.respond_to?(:force_encoding)
135 output.force_encoding('UTF-8') 135 output.force_encoding('UTF-8')
136 end 136 end
137 begin 137 begin
138 @summary = ActiveSupport::XmlMini.parse(output)['rhsummary'] 138 @summary = parse_xml(output)['rhsummary']
139 rescue 139 rescue
140 end 140 end
141 end 141 end
142 end 142 end
143 private :summary 143 private :summary
149 output = io.read 149 output = io.read
150 if output.respond_to?(:force_encoding) 150 if output.respond_to?(:force_encoding)
151 output.force_encoding('UTF-8') 151 output.force_encoding('UTF-8')
152 end 152 end
153 begin 153 begin
154 ActiveSupport::XmlMini.parse(output)['rhmanifest']['repository']['manifest'] 154 parse_xml(output)['rhmanifest']['repository']['manifest']
155 rescue 155 rescue
156 end 156 end
157 end 157 end
158 path_prefix = path.blank? ? '' : with_trailling_slash(path) 158 path_prefix = path.blank? ? '' : with_trailling_slash(path)
159 159
197 if output.respond_to?(:force_encoding) 197 if output.respond_to?(:force_encoding)
198 output.force_encoding('UTF-8') 198 output.force_encoding('UTF-8')
199 end 199 end
200 begin 200 begin
201 # Mercurial < 1.5 does not support footer template for '</log>' 201 # Mercurial < 1.5 does not support footer template for '</log>'
202 ActiveSupport::XmlMini.parse("#{output}</log>")['log'] 202 parse_xml("#{output}</log>")['log']
203 rescue 203 rescue
204 end 204 end
205 end 205 end
206 as_ary(log['logentry']).each do |le| 206 as_ary(log['logentry']).each do |le|
207 cpalist = as_ary(le['paths']['path-copied']).map do |e| 207 cpalist = as_ary(le['paths']['path-copied']).map do |e|