diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-07-09 15:18:47 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-07-09 15:18:47 +0000 |
commit | c7213ab4d657c0af1cf5034d70ec8c3d04dcbcd0 (patch) | |
tree | 5d2c0cde11758bc349d2ca1ea39ee29a19179d5b /app/models/repository | |
parent | a9ac06fea567a4dc2779e956f832cb5881dae30e (diff) | |
download | redmine-c7213ab4d657c0af1cf5034d70ec8c3d04dcbcd0.tar.gz redmine-c7213ab4d657c0af1cf5034d70ec8c3d04dcbcd0.zip |
use a normal unless-statement over a modifier clause in a multiline statement at app/models/repository/bazaar.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19875 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository')
-rw-r--r-- | app/models/repository/bazaar.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb index e09aa942d..6377139c9 100644 --- a/app/models/repository/bazaar.rb +++ b/app/models/repository/bazaar.rb @@ -100,23 +100,25 @@ class Repository::Bazaar < Repository # loads changesets by batches of 200 identifier_to = [identifier_from + 199, scm_revision].min revisions = scm.revisions('', identifier_to, identifier_from) - transaction do - revisions.reverse_each do |revision| - changeset = Changeset.create(:repository => self, - :revision => revision.identifier, - :committer => revision.author, - :committed_on => revision.time, - :scmid => revision.scmid, - :comments => revision.message) + unless revisions.nil? + transaction do + revisions.reverse_each do |revision| + changeset = Changeset.create(:repository => self, + :revision => revision.identifier, + :committer => revision.author, + :committed_on => revision.time, + :scmid => revision.scmid, + :comments => revision.message) - revision.paths.each do |change| - Change.create(:changeset => changeset, - :action => change[:action], - :path => change[:path], - :revision => change[:revision]) + revision.paths.each do |change| + Change.create(:changeset => changeset, + :action => change[:action], + :path => change[:path], + :revision => change[:revision]) + end end end - end unless revisions.nil? + end identifier_from = identifier_to + 1 end end |