问题
I'm pretty new to mercurial and after reading a few tutorials I'm still doubtful on what's the best way to do what I intend to do with it.
My goal would be to mantain a CMS that I'm developing (adding new features, fixing bugs, etc.) and being able to easily distributes those updates to websites I make with said CMS.
I started by making a repository for the CMS itself, then when I want to make a new website clone the CMS repository and work on it.
Now the questions: working on a website there are changes that will be specific for that and changes that I'd like to see also on the main CMS repository. How to distinguish them?
Should I create a new branch and commit all the website specific changes to that branch and the general changes to the default branch? Or shall I use tags?
What I'm looking for is an easy way to push back changes to the CMS repository, then continue to develop the CMS (in other websites for example) and eventually update all websites I made with the CMS with new features and bug fixes without too much hassle.
What's the best way to deal with the situation I described?
Thanks in advance.
回答1:
Well, you really ask at least two questions (as I see)
- How to maintain diverged lines of development?
- How to easy distribute changes from one (?) DEVEL env to different PRODs env
Full final answer on second question will require to clarify many of the specific details, and I propose that we'll postpone it for a while.
On the first question: you are right, named branches (into which you periodically merge default branch with shared changes) for sites inside single repo may be good choice (not tags, which are only easy memorable labels for changesets).
Alternative solution may use mq on top of single default branch (with separate mq-queues for each site)
来源:https://stackoverflow.com/questions/13357966/mantaining-a-cms-and-websites-with-mercurial