##// END OF EJS Templates
scm: mercurial: code clean up adapter....
Toshi MARUYAMA -
r5359:a8e7936337d1
parent child
Show More
@@ -193,7 +193,6 module Redmine
193 rescue
193 rescue
194 end
194 end
195 end
195 end
196
197 as_ary(log['logentry']).each do |le|
196 as_ary(log['logentry']).each do |le|
198 cpalist = as_ary(le['paths']['path-copied']).map do |e|
197 cpalist = as_ary(le['paths']['path-copied']).map do |e|
199 [e['__content__'], e['copyfrom-path']].map do |s|
198 [e['__content__'], e['copyfrom-path']].map do |s|
@@ -201,20 +200,19 module Redmine
201 end
200 end
202 end
201 end
203 cpmap = Hash[*cpalist.flatten]
202 cpmap = Hash[*cpalist.flatten]
204
205 paths = as_ary(le['paths']['path']).map do |e|
203 paths = as_ary(le['paths']['path']).map do |e|
206 p = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['__content__']) )
204 p = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['__content__']) )
207 {:action => e['action'], :path => with_leading_slash(p),
205 {:action => e['action'],
208 :from_path => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
206 :path => with_leading_slash(p),
207 :from_path => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
209 :from_revision => (cpmap.member?(p) ? le['revision'] : nil)}
208 :from_revision => (cpmap.member?(p) ? le['revision'] : nil)}
210 end.sort { |a, b| a[:path] <=> b[:path] }
209 end.sort { |a, b| a[:path] <=> b[:path] }
211
212 yield Revision.new(:revision => le['revision'],
210 yield Revision.new(:revision => le['revision'],
213 :scmid => le['node'],
211 :scmid => le['node'],
214 :author => (le['author']['__content__'] rescue ''),
212 :author => (le['author']['__content__'] rescue ''),
215 :time => Time.parse(le['date']['__content__']),
213 :time => Time.parse(le['date']['__content__']),
216 :message => le['msg']['__content__'],
214 :message => le['msg']['__content__'],
217 :paths => paths)
215 :paths => paths)
218 end
216 end
219 self
217 self
220 end
218 end
General Comments 0
You need to be logged in to leave comments. Login now