Prevent multiple heads in default branch for mercurial repositories

Is there proper way to preventing creating new heads in RhodeCode-managed hg repository with:

$ hg push -f


Currently I’m using custom hook scripts in .hg/hgrc but is there a better way?

The custom .hg/hgrc is currently the way to go. However please check out this ticket:

We’re going to roll this out together with Branch permissions.

Thanks for the reply, looking forward for integration of this ticket.
It would be could to manage multiple heads block on repository group/global level.

Yes, we’re going to leverage our permissions system on repo groups/repos to add additional rules on branches etc. So it should have all the flexibility that we already have with regular permissions.