Wraps changeset creation inside a single transation.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3469 e93f8b46-1217-0410-a6f0-8f06a7374b81
pull/351/head
Jean-Philippe Lang 15 years ago
parent 87bc092d7c
commit 103698b371
  1. 8
      lib/redmine/scm/adapters/abstract_adapter.rb

@ -286,8 +286,8 @@ module Redmine
end
def save(repo)
if repo.changesets.find_by_scmid(scmid.to_s).nil?
changeset = Changeset.create!(
Changeset.transaction do
changeset = Changeset.new(
:repository => repo,
:revision => identifier,
:scmid => scmid,
@ -295,8 +295,9 @@ module Redmine
:committed_on => time,
:comments => message)
if changeset.save
paths.each do |file|
Change.create!(
Change.create(
:changeset => changeset,
:action => file[:action],
:path => file[:path])
@ -304,6 +305,7 @@ module Redmine
end
end
end
end
class Annotate
attr_reader :lines, :revisions

Loading…
Cancel
Save