Exclude command for users

Boris FELD boris.feld at octobus.net
Fri Aug 17 15:42:18 UTC 2018


On 16/08/2018 18:00, tamghar at astek.fr wrote:
> Hello,
>
> I'm using Mercurial 3.7.2 and want to exclude some commands to non 
> admin users.
> Any way to do that ? I'm thinking about implemented extension in 
> $HOME/.hgrc.
>
> Exemple : do not allow 'hg rollback'.

You can add config in the hook section of your hgrc to block some 
command. pre-<command> hooks, runs before <command>.

For example:

[hooks]
pre-strip=echo "strip is disabled > &2; exit 255"


See hg help config.hooks for detail.



More information about the Mercurial mailing list