I had quite some trouble setting up Mercurial/Murky to work the way I wanted it to, so I’m writing it down here so I can reference it in the future if I ever need to and maybe it can helps others too.
The default settings for Hg (Mercurial) don’t seem to be the most user-friendly. In particular I didn’t like the way the default pull/update/merge was working. Fortunately, you can tweak settings in Hg to make it work to your liking. You will need to edit the dot file .hgrc located in your home directory for this.
This is what my .hgrc file ended up looking like:
username = Ali <email@example.com>
merge = /Applications/kdiff3.app/Contents/MacOS/kdiff3
kdiff3.args = $base $local $other -o $output
The [ui] and [merge-tools] sections ensure that Mercurial uses the tool I specified for the merge operation. I found that the default merge was adding changes from both conflicting files together into one – the changes being placed on separate lines, separated by symbols like >, -, < (the same way that the command-line diff tools works). Its very hard to read through the changes this way. By specifying an external merge tool of your choice, hg will call that merge tool and let it handle the merging. In this case, I choose kdiff3, which seems to be a popular free cross-platform tool. The kdiff3 merge shows me both the files side by side with the changes highlighted in colour. Its easier to figure out what’s changed this way. Here’s some more information on Mercurial merge tools:http://mercurial.selenic.com/wiki/MergeProgram
In the [ui] section, I also included a username part. This ensures that when I push to Bitbucket, it links my push to my bitbucket account. Otherwise it will display the username and machine you are committing from as your username. Refer to the FAQ for more details.
The version of Murky that I’m using (v0.8.1) doesn’t let you do a hg push if you checked out your repository through https. You can still do it through the command line, but that is annoying. So I suggest cloning your repository through the ssh url that bitbucket provides. This is a known issue and might be fixed in the future.