开发者

Mercurial: repository layout for multi-customer project

We have this webapp product being deployed for multiple customers and think about switching from svn to mercurial. In svn, we see the trunk as our projects 'core', while branches are setup for each customer.

Now I wonder what the best repo layout might be in mercurial.

Lets say the project basically is made out of three main folders: html, css, js.

While the contents of /html stay the same across 开发者_C百科customers, we have customizations in /css & /js.

Right now these customizations live in separate files, such as skin.css, so we can clearly tell the real on-purpose-customizations from fixes/changes to the core/common files.

SVN then lets us partially commit changes from customer branches back to the trunk, so we can fix global stuff while working on customer projects. As I understand, partial commits are not supported in mercurial right now.

So, how do we best approach this situation in mercurial? Should we have one central core repo(possibly with release branches) and clone customer projects as separate (remote) repos? Is it better to have all - core & customer branches - inside one repo?

Thanks a lot for any pointer!


I would split the project to two repos: core (html) and customer (css, js). "core" is easy to understand. For "customer", I would start with a generic or fallback set of styles. Then make a clone off the generic styles for each customer. To make a build for one customer, you need to pull from both core and that customer clone. This way different customers are isolated but still know about each other through the generic style. So if there's any style you want to change cross all customers, you just need to commit to the generic styles and let each customer clone pull. I wouldn't make different customers totally different repos.

The problem with having one single repo is whenever you make a clone for one customer, you carry around an irrelevant part (html). And unexpected modifications can be easily leaked into html. For the same reason, your project should probably have been split to two projects even in SVN.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜