]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: lib: add parents to Revision class (#5501)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Oct 2011 04:56:41 +0000 (04:56 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Oct 2011 04:56:41 +0000 (04:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7666 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/mercurial_adapter.rb

index 53f24735c0d7ff5c7661b76ac7e829785c90783a..0d69656361c294bfd6d866095cc3463b1db70b43 100644 (file)
@@ -210,12 +210,17 @@ module Redmine
                :from_path     => (cpmap.member?(p) ? with_leading_slash(cpmap[p]) : nil),
                :from_revision => (cpmap.member?(p) ? le['node'] : nil)}
             end.sort { |a, b| a[:path] <=> b[:path] }
+            parents_ary = []
+            as_ary(le['parents']['parent']).map do |par|
+              parents_ary << par['__content__'] if par['__content__'] != "000000000000"
+            end
             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)
+                               :paths    => paths,
+                               :parents  => parents_ary)
           end
           self
         end