Using SourceTree 1.5.3 with embedded Mercurial on OS X 10.6

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

SourceTree fails to clone a repository.

Diagnosis

Environment

  • Mac OS X 10.6 - Snow Leopard
  • Python default version 2.5.4
  • SourceTree version 1.5.3 and embedded Mercurial 2.2.2

Diagnostic Steps

  • clone a repository such as https://bitbucket.org/sinbad/ssselectabletoolbar with the New menu entry
  • SourceTree goes ahead and uses the system Python version found at /usr/bin/python to execute Mercurial commands
  • The execution of the Mercurial commands fail

Cause

The commands fail because of syntax errors with regards to Mac OS X 10.6 - Snow Leopard having Python 2.5.4 but Mercurial needing Python 2.6+.

Resolution options

Resolution 1

When SourceTree is using embedded Mercurial, it is actually calling the python script at "/Applications/SourceTree.app/Contents/Resources/mercurial_local/hg_local". Editing this script will show that the first line is calling "#!/usr/bin/env python". This is in fact the shebang that tells embedded Mercurial to use the system python (reference: http://en.wikipedia.org/wiki/Shebang_(Unix)#Strengths). If that first line is replaced with something like "#!<path-to-python-2.6+>" then SourceTree with embedded Mercurial would call the version of Python to be used instead of the system Python. In addition, it might be necessary to disable some hg extension, such as hgsubversion or hgattic for example.

Resolution 2

Rename the /usr/bin/python folder and create a symbolic link to a higher Python version at /usr/bin/python.

Mercurial commands can be executed and the repository can then be cloned.

Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.