How to install and configure TortoiseHg on Mac
I finally got fed up with SourceTree and installed TortoiseHg on my Mac development machine. Read on:
Xcode Configuration
For best results make sure you have the latest XCode and Command Line Tools installed (XCode 5 and Command Line Tools September 2013 at the time of this writing). You can get them from the Apple Developer Downloads site.
1. Install / Update Ruby
should return something like:You can skip the rest of this section if you have Ruby already installed.
Install the Ruby Version Manager and Ruby
2. Install Homebrew
Follow the instructions in the script. The installation will take a few minutes.
Verify your brew installation
This returned a few problems for me, but the output will vary depending on the existing system configuration.
Warning: An outdated version of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade: brew upgrade git
Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.
Warning: You have MacPorts or Fink installed:
/Users/yourname/.rvm/bin/port, /opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew.
Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
echo export PATH="/usr/local/bin:$PATH" >> ~/.bash_profile
Warning: Your Xcode (x.y.z) is outdated
Please install Xcode a.b.c
The issues will depend on your specific installation. Use your best judgement about what to fix and what to ignore. Fixing one by one:
Warning: You have MacPorts or Fink installed
Warning: /usr/bin occurs before /usr/local/bin
Warning: An outdated version of Git was detected in your PATH.
or if you do not have Git at all:
Warning: Your Xcode (x.y.z) is outdated
You can ignore this one.
Warning: /Library/Frameworks/Mono.framework detected
You can ignore this one.
3. Install Python packages
I had Python already installed before Homebrew, so I had to amend PYTHONPATH like so:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
echo export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH" >> ~/.bash_profile
Then install PyQt (this also installs qt and sip):
Install QScintilla
Install Python Package Mananger (pip)
Install Pygments, iniparse and Mercurial Python packages. If you have Mercurial already, this will update it to the latest version.
4. Install TortoiseHg
Clone TortoiseHg repository using Mercurial:
hg clone http://bitbucket.org/tortoisehg/thg/ ~/Tools/TortoiseHg
cd ~/Tools/TortoiseHg/
hg update stable
Quick test. You should see TortoiseHg Workbench running:
5. Install TortoiseHg Mac App
Clone thg-mac-app repository
Set the TORTOISEHG_PATH variable
Edit ~/tortoisehg-path.sh
so it points to ~/Tools/TortoiseHg
. This is what ~/tortoisehg-path.sh
looks like after the change:
``` bash
!/bin/sh
export TORTOISEHG_PATH=~/Tools/TortoiseHg ```
Install TortoiseHg.app
Option + Drag the TortoiseHg.app from ~/Tools/thg-mac-app
to your Applications folder.