Mercurial tips

This is a collection of various tips and tricks for improving your Mercurial experience.


These settings normally go into ~/.config/hg/hgrc or ~/.hgrc.

This command opens your config file in an editor:

hg config --edit

User interface

Mercurial ships with very conservative defaults. Enabling ui.tweakdefaults, as the name implies, tweaks the defaults for various other settings.

This results in a much more modern experience, but things may change behaviour between versions.

tweakdefaults = True

See hg help ui.config and search for tweakdefaults for more information.


Phase colors

This makes phases more obvious.

changeset.public = green
changeset.secret = red


ui.warning = yellow

Appropriate warning color. Errors are already red by default.


ignorews = True

Ignore white space in hg annotate.


update.check = noconflict

This makes hg update abort if there is potential for a merge conflict. This way you can mentally prepare for dealing with it instead of suddenly dropping unprepared into vimdiff.

Note: This is currently enabled by ui.tweakdefaults.


The configuration format supports includes, so snippets can be split into multiple files if you prefer organizing like that.

%include ~/.config/hg/hgrc.d/*.rc



publish = False

This prevents marking changes as published when pushed between local repositories.