@@ -180,10 +180,13 class Repository::Git < Repository | |||
|
180 | 180 | # So, Redmine needs to scan revisions and database every time. |
|
181 | 181 | # |
|
182 | 182 | # This is replacing the one-after-one queries. |
|
183 |
# Find all revisions, that are in the database, and then remove them |
|
|
183 | # Find all revisions, that are in the database, and then remove them | |
|
184 | # from the revision array. | |
|
184 | 185 | # Then later we won't need any conditions for db existence. |
|
185 |
# Query for several revisions at once, and remove them |
|
|
186 | # Do this in chunks, to avoid eventual memory problems (in case of tens of thousands of commits). | |
|
186 | # Query for several revisions at once, and remove them | |
|
187 | # from the revisions array, if they are there. | |
|
188 | # Do this in chunks, to avoid eventual memory problems | |
|
189 | # (in case of tens of thousands of commits). | |
|
187 | 190 | # If there are no revisions (because the original code's algorithm filtered them), |
|
188 | 191 | # then this part will be stepped over. |
|
189 | 192 | # We make queries, just if there is any revision. |
@@ -198,7 +201,6 class Repository::Git < Repository | |||
|
198 | 201 | revisions.reject!{|r| recent_revisions.include?(r.scmid)} |
|
199 | 202 | offset += limit |
|
200 | 203 | end |
|
201 | ||
|
202 | 204 | revisions.each do |rev| |
|
203 | 205 | transaction do |
|
204 | 206 | # There is no search in the db for this revision, because above we ensured, |
@@ -240,7 +242,6 class Repository::Git < Repository | |||
|
240 | 242 | def latest_changesets(path,rev,limit=10) |
|
241 | 243 | revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false) |
|
242 | 244 | return [] if revisions.nil? || revisions.empty? |
|
243 | ||
|
244 | 245 | changesets.where(:scmid => revisions.map {|c| c.scmid}).all |
|
245 | 246 | end |
|
246 | 247 |
General Comments 0
You need to be logged in to leave comments.
Login now