开发者

How to svn/cvs multiple projects with custom shared modules?

at our company we have some drupal projects that share some custom developed modules, so in svn, we have a dir structure l开发者_如何学JAVAike this:

project 1
-- sites
-- -- all
-- -- -- modules
-- -- -- -- custom
-- -- -- -- -- my_mod1

project 2
-- sites
-- -- all
-- -- -- modules
-- -- -- -- custom
-- -- -- -- -- my_mod2

Now, we want to share my_mod1 in other projects, like project 2, but if we simply copy/added it to svn, it will be difficult to maintain (dupe code, each one on one repo, so if we modify one, we will need to modify the other).

Probably, the ideal will be to have a central repo of custom modules, but I don't know if this is possible, or how to do it, so, please, we need your help with this ;).

Thanks in advance!


I'd suggest using SVN externals.

This way, every working copy can be made up of files from different repositories.

So, if for example you created a central repository of custom modules, then in each of your projects you could do something like this:

$ svn propset svn:externals "sites/all/modules/custom  
     http://hostname/modulesrepos" .

This will then checkout the directories in /modulesrepos to sites/all/modules/custom. If you do this for all of your projects, and treat the 'live' website as a working copy, then it will always pull the modules from your 'external' repos.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜