I would like, when a user commit a changeset, to show a message mentioning the branch where the changeset was committed.
Example:
$hg commit -m 'Fix bug'
Changeset committed on branch bugfix
Do I actually need to modify the hg commit code or is it a quicker/simpler way of doing it?
Add to your repository's .hg/hgrc:
[hooks]
commit=echo "Changeset committed on branch `hg branch`"
ssg's answer is unfortunately not portable to e.g. Windows (because of the backticks), but this should work:
# UNIX-like
[hooks]
commit=hg log -r $HG_NODE --template "Committing on branch {branch}\n"
or
# Windows
[hooks]
commit=hg log -r %HG_NODE% --template "Committing on branch {branch}\n"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With