Subversion: latest changesets performance improvement.
Redmine executes "svn log" command 2 times (Repository::Subversion#fetch_changesets and Repository::Subversion#latest_changesets) when performing repository/show action. As a result, it takes very long time to complete when the repository is on remote server.
This patch improves performance of the Subversion#latest_changesets method by querying changesets table on the database instead of executing "svn log" command.
scm: mercurial: improvement latest_changesets without supporting tags and named branches (#4455).
Based on latest-changesets-improvements-2.diff of #6159.
Contributed by Yuya Nishihara.
#1 Updated by Yuya Nishihara almost 10 years ago
- File latest-changesets-improvements.diff added
How about fixing
Repository.latest_changesets, then makes use of it?
- filter by
changes.path = "..." OR changes.path LIKE ".../%".
JOIN changesfor path condition; then
SELECT DISTINCT changesets.*to strip duplicated records.
ORDER BYstatement are declared by
has_many :changesets, :order => ..., so no need to specify explicitly.
#4 Updated by Toshi MARUYAMA over 9 years ago
- File latest-changesets-improvements-4.diff added
- File svn-before-patch.png added
- File svn-after-patch.png added
- File bazaar-before-patch.png added
- File bazaar-after-patch.png added
I have updated Yuya's patch as latest-changesets-improvements-4.diff.
cd path/to/your/redmine patch -p1 < latest-changesets-improvements-4.diff
The reasons of updating are following.
- Subversion latest_changesets switches "file://" or not.
- Add Mercurial ordering to resolve #3449 and #3567
Subversion latest_changesets switches "file://" or not¶
Redmine 1.0.4 shows all revisions of branch and tag.
For example, http://www.redmine.org/projects/redmine/repository/show/tags/1.0.4 shows
r4448 (tagged version 1.0.4), r4447, r4445...
But Yuya's patch shows only r4448.
I have updated as following.
- "file://": use "svn log"
- The others: use only database
Improvement of browsing sub directory for other SCMs¶
This patch improves other SCMs which does not override latest_changesets.
Other SCMs are CVS, Bazaar, Darcs and Mercurial.
Subversion and Git overrides latest_changesets.
Redmine 1.0.4 does not show "latest revisions" of sub directory.
This patch shows it.
Following images are Bazaar images of test repository (source:tags/1.0.4/test/fixtures/repositories/bazaar_repository.tar.gz) .