scm: mercurial: code clean up adapter.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5479 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c80fe134f5
commit
a8e7936337
|
@ -193,7 +193,6 @@ module Redmine
|
||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
as_ary(log['logentry']).each do |le|
|
as_ary(log['logentry']).each do |le|
|
||||||
cpalist = as_ary(le['paths']['path-copied']).map do |e|
|
cpalist = as_ary(le['paths']['path-copied']).map do |e|
|
||||||
[e['__content__'], e['copyfrom-path']].map do |s|
|
[e['__content__'], e['copyfrom-path']].map do |s|
|
||||||
|
@ -201,20 +200,19 @@ module Redmine
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
cpmap = Hash[*cpalist.flatten]
|
cpmap = Hash[*cpalist.flatten]
|
||||||
|
|
||||||
paths = as_ary(le['paths']['path']).map do |e|
|
paths = as_ary(le['paths']['path']).map do |e|
|
||||||
p = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['__content__']) )
|
p = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['__content__']) )
|
||||||
{:action => e['action'], :path => with_leading_slash(p),
|
{:action => e['action'],
|
||||||
:from_path => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
|
:path => with_leading_slash(p),
|
||||||
|
:from_path => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
|
||||||
:from_revision => (cpmap.member?(p) ? le['revision'] : nil)}
|
:from_revision => (cpmap.member?(p) ? le['revision'] : nil)}
|
||||||
end.sort { |a, b| a[:path] <=> b[:path] }
|
end.sort { |a, b| a[:path] <=> b[:path] }
|
||||||
|
|
||||||
yield Revision.new(:revision => le['revision'],
|
yield Revision.new(:revision => le['revision'],
|
||||||
:scmid => le['node'],
|
:scmid => le['node'],
|
||||||
:author => (le['author']['__content__'] rescue ''),
|
:author => (le['author']['__content__'] rescue ''),
|
||||||
:time => Time.parse(le['date']['__content__']),
|
:time => Time.parse(le['date']['__content__']),
|
||||||
:message => le['msg']['__content__'],
|
:message => le['msg']['__content__'],
|
||||||
:paths => paths)
|
:paths => paths)
|
||||||
end
|
end
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue