changeset 257:4adccef8964d

* Explicitly request 32-bit Python on OS/X 10.6
author Chris Cannam
date Wed, 12 Jan 2011 15:46:05 +0000
parents 12df2232e40a
children a574b89bfddd
files hgrunner.cpp
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgrunner.cpp	Wed Jan 12 13:08:39 2011 +0000
+++ b/hgrunner.cpp	Wed Jan 12 15:46:05 2011 +0000
@@ -381,6 +381,9 @@
     bool interactive = false;
     QStringList params = action.params;
 
+    QSettings settings;
+    settings.beginGroup("General");
+
     if (executable == "") {
         // This is a Hg command
         executable = getHgBinaryName();
@@ -389,8 +392,6 @@
             params.push_front("ui.interactive=true");
             params.push_front("--config");
 
-            QSettings settings;
-            settings.beginGroup("General");
             if (settings.value("useextension", true).toBool()) {
                 QString extpath = getExtensionLocation();
                 params.push_front(QString("extensions.easyhg=%1").arg(extpath));
@@ -415,11 +416,20 @@
     QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
 
 #ifdef Q_OS_WIN32
+    // On Win32 we like to bundle Hg and other executables with EasyHg
     if (m_myDirPath != "") {
         env.insert("PATH", m_myDirPath + ";" + env.value("PATH"));
     }
 #endif
 
+#ifdef Q_OS_MAC
+    // On OS/X 10.6, Python is 64-bit by default but our Hg extension
+    // is only available in 32-bit
+    if (settings.value("python32", true).toBool()) {
+        env.insert("VERSIONER_PYTHON_PREFER_32_BIT", 1);
+    }
+#endif
+
     env.insert("LANG", "en_US.utf8");
     env.insert("LC_ALL", "en_US.utf8");
     env.insert("HGPLAIN", "1");