I'm just starting to use Mercurial as a version control system. I was thinking of using a workflow similar to the one described here: http://stevelosh.com/blog/2010/05/mercurial-workflows-stable-default/ . In principle, there are two branches: one is Stable and Development. All development will be carried out on the Development branch and will only be merged into the Stable branch when they are tested and ready for release.
o | v2.0
|\|
| o added new feature
o | V1.0
|\|
| o added new feature
| |
| o fixed bug
o |
I do not want developers to accidentally change changes to a stable branch. How can i achieve this? I know that there are ways to connect to certain Mercurial events, but who can refuse the push if it has made changes to the stable branch? And how can I detect that changes have been made to specific branches within the hook?
I am running Windows 7 by the way.
UPDATE
Thanks to criswel for his answer - he pointed me in the right direction. It turns out that the ACL extension (which comes with Mercury) solved this problem. I edited the “hgrc” file in the main repo “.hg” folder to look like this:
[extensions]
acl =
[hooks]
pretxnchangegroup.acl = python:hgext.acl.hook
[acl]
sources = push
[acl.deny.branches]
stable = *
This stops anyone who makes changes to the stable branch and redirects them to the main repo.