A hg extension that provides some extra sanity checks when committing to sensitive branches.
To install, clone this repo somewhere, and add the following to your .hgrc:
[extensions] idiocy = /path/to/cloned/repo/idiocy.py
By default the only sensitive branch is "release". If you want to change this, add a section like this:
[idiocy] branches = release,ui-changes
If you have the color extension installed and active, the list of files will be displayed in colour. Note that I haven't tested this with any other output-altering extension, let me know if you have issues.
I haven't tested this on Windows, with any output altering extension other than color, and with any version of mercurial before 1.9 and after 2.0.
The extension doesn't really work within PyCharm - instead of the full list of files, you get a disembodied pop-up dialog. It will prevent you from committing if you hit no, but the integration could be a lot better.
I'm open to fixing issues in these areas - please let me know if you find any other and I'll see what I can do.
The extension was written after I committed a mortal sin and committed to the release branch without testing properly. It is named in attempt to prevent such idiocy again.
- Some automated testing
- Improve the message shown when you bail out
- PyCharm support
- Show a warning based on the time of day (discourage committing anywhere sensitive in the afternoon, for example)
- A maths problem or a captcha to prevent enter-itis