invert project <-> repository relationship
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.
#5 Updated by Robert Rath about 1 year ago
Thank you Jens,
I have found this patch invaluable and have updated the patch against redmine-1.3-stable r9308 for convenience.
#7 Updated by Jens Krämer about 1 year 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.
#9 Updated by Roman Lukmanov 4 months ago
I've applied this patch (invert_project_repository_relationship_2-1.3-stable-9308.patch) and get the 500 error.
[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