]> source.dussan.org Git - redmine.git/commitdiff
Transaction for each imported subversion changeset.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Mar 2009 13:32:33 +0000 (13:32 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Mar 2009 13:32:33 +0000 (13:32 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2563 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/subversion.rb

index a745897052311c051ecfc7cfb3c5041aa07cf88d..98d05e610e34fd7c96ab9cfeb555a63890e78016 100644 (file)
@@ -54,8 +54,8 @@ class Repository::Subversion < Repository
           # loads changesets by batches of 200
           identifier_to = [identifier_from + 199, scm_revision].min
           revisions = scm.revisions('', identifier_to, identifier_from, :with_paths => true)
-          transaction do
-            revisions.reverse_each do |revision|
+          revisions.reverse_each do |revision|
+            transaction do
               changeset = Changeset.create(:repository => self,
                                            :revision => revision.identifier, 
                                            :committer => revision.author, 
@@ -68,7 +68,7 @@ class Repository::Subversion < Repository
                               :path => change[:path],
                               :from_path => change[:from_path],
                               :from_revision => change[:from_revision])
-              end
+              end unless changeset.new_record?
             end
           end unless revisions.nil?
           identifier_from = identifier_to + 1