From 5600c3cf5afd54c6e3c9fb1ccd0b1922310577db Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 23 Nov 2019 15:11:40 +0000 Subject: [PATCH] cleanup: rubocop: fix Style/MultilineIfModifier in app/models/repository/subversion.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19215 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 1 - app/models/repository/subversion.rb | 27 +++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index af6042e3d..a04b91d2b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1246,7 +1246,6 @@ Style/MultilineIfModifier: - 'app/models/issue_query.rb' - 'app/models/query.rb' - 'app/models/repository/bazaar.rb' - - 'app/models/repository/subversion.rb' - 'app/models/time_entry_query.rb' - 'app/views/common/feed.atom.builder' - 'lib/redmine/access_keys.rb' diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb index f6e37fbd6..c42ffd495 100644 --- a/app/models/repository/subversion.rb +++ b/app/models/repository/subversion.rb @@ -68,19 +68,22 @@ 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) - revisions.reverse_each do |revision| - transaction do - changeset = Changeset.create(:repository => self, - :revision => revision.identifier, - :committer => revision.author, - :committed_on => revision.time, - :comments => revision.message) - - revision.paths.each do |change| - changeset.create_change(change) - end unless changeset.new_record? + unless revisions.nil? + revisions.reverse_each do |revision| + transaction do + changeset = Changeset.create(:repository => self, + :revision => revision.identifier, + :committer => revision.author, + :committed_on => revision.time, + :comments => revision.message) + unless changeset.new_record? + revision.paths.each do |change| + changeset.create_change(change) + end + end + end end - end unless revisions.nil? + end identifier_from = identifier_to + 1 end end -- 2.39.5