Mercurial > hg > soundsoftware-site
diff app/models/repository/git.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children | a1bdbf8a87d5 |
line wrap: on
line diff
--- a/app/models/repository/git.rb Tue Sep 09 09:28:31 2014 +0100 +++ b/app/models/repository/git.rb Tue Sep 09 09:29:00 2014 +0100 @@ -93,11 +93,10 @@ end end - def entries(path=nil, identifier=nil) - entries = scm.entries(path, identifier, :report_last_commit => extra_report_last_commit) - load_entries_changesets(entries) - entries + def scm_entries(path=nil, identifier=nil) + scm.entries(path, identifier, :report_last_commit => extra_report_last_commit) end + protected :scm_entries # With SCMs that have a sequential commit numbering, # such as Subversion and Mercurial, @@ -180,10 +179,13 @@ # So, Redmine needs to scan revisions and database every time. # # This is replacing the one-after-one queries. - # Find all revisions, that are in the database, and then remove them from the revision array. + # Find all revisions, that are in the database, and then remove them + # from the revision array. # Then later we won't need any conditions for db existence. - # Query for several revisions at once, and remove them from the revisions array, if they are there. - # Do this in chunks, to avoid eventual memory problems (in case of tens of thousands of commits). + # Query for several revisions at once, and remove them + # from the revisions array, if they are there. + # Do this in chunks, to avoid eventual memory problems + # (in case of tens of thousands of commits). # If there are no revisions (because the original code's algorithm filtered them), # then this part will be stepped over. # We make queries, just if there is any revision. @@ -192,13 +194,12 @@ revisions_copy = revisions.clone # revisions will change while offset < revisions_copy.size scmids = revisions_copy.slice(offset, limit).map{|x| x.scmid} - recent_changesets_slice = changesets.where(:scmid => scmids).all + recent_changesets_slice = changesets.where(:scmid => scmids) # Subtract revisions that redmine already knows about recent_revisions = recent_changesets_slice.map{|c| c.scmid} revisions.reject!{|r| recent_revisions.include?(r.scmid)} offset += limit end - revisions.each do |rev| transaction do # There is no search in the db for this revision, because above we ensured, @@ -240,7 +241,6 @@ def latest_changesets(path,rev,limit=10) revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false) return [] if revisions.nil? || revisions.empty? - changesets.where(:scmid => revisions.map {|c| c.scmid}).all end