Patch #6159
openSubversion: latest changesets performance improvement.
0%
Description
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.
Files
Related issues
Updated by Yuya Nishihara over 14 years ago
How about fixing Repository.latest_changesets
, then makes use of it?
See latest-changesets-improvements.diff
- filter by
changes.path = "..." OR changes.path LIKE ".../%"
. JOIN changes
for path condition; thenSELECT DISTINCT changesets.*
to strip duplicated records.ORDER BY
statement are declared byhas_many :changesets, :order => ...
, so no need to specify explicitly.
- use
Repository.latest_changesets
Updated by Yuya Nishihara over 14 years ago
Yuya Nishihara wrote:
Oops, it has a bug on escaping LIKE pattern. Fixed as latest-changesets-improvements-2.diff
Updated by Enrique Garcia about 14 years ago
Updated Yuya's patch so it uses relative paths for easy patching
(see latest-changesets-improvements-3.diff)
Usage:
cd path/to/your/redmine patch -p0 < latest-changesets-improvements-3.diff
Updated by Toshi MARUYAMA about 14 years ago
- File latest-changesets-improvements-4.diff latest-changesets-improvements-4.diff added
- File svn-before-patch.png svn-before-patch.png added
- File svn-after-patch.png svn-after-patch.png added
- File bazaar-before-patch.png bazaar-before-patch.png added
- File bazaar-after-patch.png bazaar-after-patch.png added
I have updated Yuya's patch as latest-changesets-improvements-4.diff.
Usage:
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
It maybe better to be configurable whether using "svn log" or "only database" such as note-5 of #6092.
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) .
Mercurial ordering¶
Yuya's hg-changeset-order.patch of #4455 overrides Mercurial latest_changesets and add "order by id DESC" to resolve #3449 and #3567.
But, if we apply this patch, we do not need to override it.
Updated by Toshi MARUYAMA almost 14 years ago
- Subject changed from Repository::Subversion#latest_changesets performance inprovement. to Repository::Subversion#latest_changesets performance improvement.
Fix subject typo.
Updated by Toshi MARUYAMA over 13 years ago
- Subject changed from Repository::Subversion#latest_changesets performance improvement. to Subversion: latest changesets performance improvement.