Blocking write-access to a specific branch in a single mercurial repository

1

Is it possible to write some manner of hook in mercurial that will reject changesets that effect a specific named branch in a repository?

We have a managed project and would like to allow any developers to push their changes to our repository so long as they are in their own named branch. We'd like to block any attempts to write to the default branch from outsiders (we would, internally, merge their branches over).

goathens

Posted 2009-09-28T18:03:40.517

Reputation: 275

1I think this question might be better suited for stackoverflow. – alex – 2009-09-28T18:05:41.853

Looks like goathens did ask and get an answer over at stackoverflow: http://stackoverflow.com/questions/1488604/blocking-write-access-to-a-specific-branch-in-a-single-mercurial-repository/1490480#1490480

Maybe someone should delete this one?

– Ry4an Brase – 2009-11-08T18:43:58.797

Answers

1

It looks like you could do this with pretxnchangegroup or pretxncommit, but you'd have to do the legwork (poking into the changesets and finding out which branch they affect) yourself.

See the Mercurial book section on hooks

Justin Love

Posted 2009-09-28T18:03:40.517

Reputation: 966

0

With a small registration process, you could give each of them a complete repository, which admittadly isn't quite as convient as branches. A variation is to us a service like BitBucket to handle some of the fork tracking for you.

Justin Love

Posted 2009-09-28T18:03:40.517

Reputation: 966