Prevent commit to wrong named branch

jf jfmeteo at gmail.com
Mon May 9 09:44:16 UTC 2011


Hi,

>> I'm planning to use mercurial with named banches, but I think it's too easy to commit something in the wrong branch
>> It would be great if I could add an option to "hg commit" which will blame me if I'm not where I think I am, for example: hg commit -b branch_1_0 -m "msg"
>> commit aborted: silly dev: you're in default branch not in branch_1_0

> Yes, you could use the precommit hook.

Please could you tell me more, especially how a hook can add options
to command line ?
Thanks.



More information about the Mercurial mailing list