summaryrefslogtreecommitdiffstats
path: root/app/models/repository
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-03 08:02:22 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-03 08:02:22 +0000
commitf63dc936ad274ca765f531b13595f63677529fc8 (patch)
tree18607a090d07e600df472c52ff9402d691a6df0b /app/models/repository
parentef1223dd3a1c6c136d7671e5ad5d14ad11d3698a (diff)
downloadredmine-f63dc936ad274ca765f531b13595f63677529fc8.tar.gz
redmine-f63dc936ad274ca765f531b13595f63677529fc8.zip
scm: git: model: save parent/child relation for changesets (#5501)
Contributed by Jan TopiƄski. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7711 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository')
-rw-r--r--app/models/repository/git.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb
index 401647948..cd2a5768d 100644
--- a/app/models/repository/git.rb
+++ b/app/models/repository/git.rb
@@ -149,7 +149,12 @@ class Repository::Git < Repository
db_rev = find_changeset_by_name(rev.revision)
transaction do
if db_rev.nil?
- save_revision(rev)
+ db_saved_rev = save_revision(rev)
+ parents = {}
+ parents[db_saved_rev] = rev.parents unless rev.parents.nil?
+ parents.each do |ch, chparents|
+ ch.parents = chparents.collect{|rp| find_changeset_by_name(rp)}.compact
+ end
end
h["branches"][br]["last_scmid"] = rev.scmid
merge_extra_info(h)