Patch #9359
openinvert project <-> repository relationship
0%
Description
This patch changes the relationship between repositories and projects, so that a single repository can be shared among multiple projects.
While you can already use the same physical repository with multiple projects without this patch, doing so leads to duplication of change records in the database as well as multiple identical changeset references on issues, because each changeset is imported n times, where n is the number of projects referencing the repository.
The patch changes Redmine's behavior to re-use an already existing repository record if possible, when the scm properties of a project are configured. A migration converting existing installations that use one ore more repositories in multiple projects to the new setup is included.
Files
Related issues
Updated by Jens Krämer about 13 years ago
Updated by Jens Krämer about 13 years ago
Updated by Robert Rath over 12 years ago
- File invert_project_repository_relationship_2-1.3-stable-9308.patch invert_project_repository_relationship_2-1.3-stable-9308.patch added
Thank you Jens,
I have found this patch invaluable and have updated the patch against redmine-1.3-stable r9308 for convenience.
...Robert
Updated by Jens Krämer over 12 years ago
I don't understand your comment ;-)
however this patch is not about multiple SCM per project but about multiple projects per SCM - so you can reference the same repository in multiple projects, i.e. one for development and one for exception tracking via the hoptoad_notifier-plugin.
Updated by Jens Krämer over 12 years ago
Robert Lemke - very appreciated - think I'll need to upgrade that Redmine setup to 1.3 or even 1.4 soon...
Updated by Roman Lukmanov almost 12 years ago
Hi!
I've applied this patch (invert_project_repository_relationship_2-1.3-stable-9308.patch) and get the 500 error.
In log:
[redmine log]# tail -15 production.log EnabledModule Load (0.1ms) SELECT name FROM `enabled_modules` WHERE (`enabled_modules`.project_id = 76) Project Load (0.0ms) Mysql::Error: Unknown column 'projects.repository_id' in 'where clause': SELECT `projects`.id FROM `projects` WHERE (`projects`.`id` = 76) AND (`projects`.repository_id = NULL) LIMIT 1 ActiveRecord::StatementInvalid (Mysql::Error: Unknown column 'projects.repository_id' in 'where clause': SELECT `projects`.id FROM `projects` WHERE (`projects`.`id` = 76) AND (`projects`.repository_id = NULL) LIMIT 1): app/controllers/repositories_controller.rb:41:in `edit' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'
Redmine version is 1.3.2
Updated by Charles Sporkman almost 12 years ago
Anyone taken a stab at getting this working under 2.2.x yet?
Updated by Robert Rath over 11 years ago
Roman Lukmanov wrote:
Hi!
I've applied this patch (invert_project_repository_relationship_2-1.3-stable-9308.patch) and get the 500 error.
In log:
[...]Redmine version is 1.3.2
Hi Roman,
Did you apply the patch against checked out Redmine 1.3 svn revision 9308? If your checked out source is too far away from this revision I can not predict the behavior. Better to study the patch and manually patch if not a direct match.
Updated by Robert Rath over 11 years ago
Greetings All,
I have just evaluated latest Redmine 2.3 stable and the old implementation has not changed. I might just take a shot at re-creating the patch. I am a little concerned about the added complexity of multiple SCM support per project.
... Robert
Updated by Robert Rath over 11 years ago
Charles Sporkman wrote:
Anyone taken a stab at getting this working under 2.2.x yet?
Hi Chris,
Thinking about having a go on the current 2.3 stable build unless you have already done it. ;-)
... Robert
Updated by Robert Rath about 11 years ago
My initial simple attempt at creating a Redmine 2.3 patch using Jens original code highlights the new complexity added by Redmine's recently added new multiple SCM per project capability. My up-ported patch simply patches the original code but does not correctly integrate into the new Redmine functionality
For my application I can live with the current 2.3 SCM structure however I still hate the fact that adding the same SCM to a new project takes a long time for large repositories to unnecessarily build the change-set over again.
I may still tackle this properly in the future if I really need it. In the mean time if anyone wants my non-functional 2.3 patch to play with then please ask.
... Robert Rath
Updated by pasquale [:dedalus] over 1 year ago
+1
this patch greatly improves the user experience
Updated by pasquale [:dedalus] 8 days ago
In addition to the issue of performance and redundancy at the database level, from a UX point of view, this problem means that, if the same assembly is shared among N projects, we will have N rows of the same changeset shown in activities page. This is confusing when managing many projects and repositories.