问题
So we have Redmine successfully integrated with SVN. It's a mature integration (a few months now). Post-commit-hook updates the repository in Redmine. Comments in SVN commit get beautifully imported into Redmine, which is able to create links between issues and revisions, log time, the whole 9 yards.
However, for time constraint issues, there was an urgent bug which had to be fixed quickly and committed without comments. The issue wasn't even in Redmine. This happened at 3:35AM, when best practices are as valued as a bag of ice for sale in the Arctic winter.
Now, this morning, we entered the issue into Redmine and want to link that crazy 3:35AM revision to it. How can that be done?
I was once able to hack that by erasing some records in Redmine database and running the repository update task. But I do not really remember right now and really really do not want to go there anymore.
Is there a way? A functionality? A plugin? A script? Anything?
Thanks in advance
Update
Oh, by the way, we already updated the comment for THAT revision, containing the valid tags and words Redmine expects.
回答1:
One possible solution to make redmine re-read svn log of the project is to delete the repository from project settings, enter it again and go to repository tab, it will probably load everything from the beginning.
It's a workaround and perhaps there's a better way, but it should still work. Deleting repository from redmine project setting will not affect your actual svn repository.
回答2:
See also reply from user3402809 to my question Associating revisions with a Redmine issue. It provides simpler and less intrusive way providing you have "Manage related issues" permission in Redmine.
回答3:
I'm not 100% on this but....
in the redmine code there is a method called fetch_changesets
that, grabs the changesets from repositories for all projects. The comment above it says:
Fetches new changesets for all repositories of active projects
Can be called periodically by an external script
eg. ruby script/runner "Repository.fetch_changesets"
there is another method under that called scan_changesets_for_issue_ids
which is what's called to rescan the comments. These are in models/repository.rb so you could modify them to clear, fetch and rescan all in 1 new method. Obviously you'll need to set SVN up to allow changing of historical commit messages.
来源:https://stackoverflow.com/questions/6047906/redmine-and-svn-how-to-link-a-revision-to-an-issue-after-the-commit-has-happene