Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
I think this question might be better suited for stackoverflow. – alex Sep 28 '09 at 18:05
Looks like goathens did ask and get an answer over at stackoverflow:… Maybe someone should delete this one? – Ry4an Nov 8 '09 at 18:43
up vote 1 down vote accepted

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

share|improve this answer

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .