summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-17 09:32:35 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-17 09:32:35 +0000
commita8e7936337d1b6f8aee05b408350df12bcde51de (patch)
tree80fbeaec5fdcda08f7748af1e24e93de40111f5c
parentc80fe134f5578dc1bd562fbb46e9dfb7e25bf1a3 (diff)
downloadredmine-a8e7936337d1b6f8aee05b408350df12bcde51de.tar.gz
redmine-a8e7936337d1b6f8aee05b408350df12bcde51de.zip
scm: mercurial: code clean up adapter.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5479 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/scm/adapters/mercurial_adapter.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
index 0df54d11c..7a9edba50 100644
--- a/lib/redmine/scm/adapters/mercurial_adapter.rb
+++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
@@ -193,7 +193,6 @@ module Redmine
rescue
end
end
-
as_ary(log['logentry']).each do |le|
cpalist = as_ary(le['paths']['path-copied']).map do |e|
[e['__content__'], e['copyfrom-path']].map do |s|
@@ -201,20 +200,19 @@ module Redmine
end
end
cpmap = Hash[*cpalist.flatten]
-
paths = as_ary(le['paths']['path']).map do |e|
p = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['__content__']) )
- {:action => e['action'], :path => with_leading_slash(p),
- :from_path => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
+ {:action => e['action'],
+ :path => with_leading_slash(p),
+ :from_path => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
:from_revision => (cpmap.member?(p) ? le['revision'] : nil)}
end.sort { |a, b| a[:path] <=> b[:path] }
-
yield Revision.new(:revision => le['revision'],
- :scmid => le['node'],
- :author => (le['author']['__content__'] rescue ''),
- :time => Time.parse(le['date']['__content__']),
- :message => le['msg']['__content__'],
- :paths => paths)
+ :scmid => le['node'],
+ :author => (le['author']['__content__'] rescue ''),
+ :time => Time.parse(le['date']['__content__']),
+ :message => le['msg']['__content__'],
+ :paths => paths)
end
self
end