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
This commit is contained in:
parent
ef1223dd3a
commit
f63dc936ad
|
@ -149,7 +149,12 @@ class Repository::Git < Repository
|
||||||
db_rev = find_changeset_by_name(rev.revision)
|
db_rev = find_changeset_by_name(rev.revision)
|
||||||
transaction do
|
transaction do
|
||||||
if db_rev.nil?
|
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
|
end
|
||||||
h["branches"][br]["last_scmid"] = rev.scmid
|
h["branches"][br]["last_scmid"] = rev.scmid
|
||||||
merge_extra_info(h)
|
merge_extra_info(h)
|
||||||
|
|
Loading…
Reference in New Issue