Search code examples
tortoisehg

Changing the TortoiseHG branch merge default commit message


I am using TortoiseHG version 2.5.1

I am part of an Open Source project in which we use different branches (mainly the current ABI, API, and default branch) which often require merges. In those cases, I use the "Merge with local" context menu option in the TortoiseHG workbench. For example, when merging the "v0-8" branch into the "default" branch, the following commit message is generated using the default settings of TortoiseHG:

Merge with v0-8

I would prefer to get an auto-generated message such as (or similar to) this one:

Merging v0-8 into default

Whereas default stands for any currently selected local branch and v0-8 stands for the one that we want to merge into the local branch. This message would make it clearly understandable what is happenin, without having to type it manually each time.

How can I do this?


Solution

  • Unfortunately there is no way to change that predefined message. TortoiseHG has that string backed into its source code. The format string which can be found in the i18n/ subdirectory, is the following:

      #, python-format
      msgid "Merge with %s"
      msgstr ""
    

    As you can see there is a single replaceable token which is the branch you're merging.