diff src/hgrunner.cpp @ 406:c567fed39559

Add ability to configure the ssh client; default to TortoisePlink on Windows
author Chris Cannam <chris.cannam@eecs.qmul.ac.uk>
date Thu, 26 May 2011 15:48:11 +0100
parents 5cc0d897eb26
children b45e6cd9f1d4
line wrap: on
line diff
--- a/src/hgrunner.cpp	Wed May 25 16:52:31 2011 +0100
+++ b/src/hgrunner.cpp	Thu May 26 15:48:11 2011 +0100
@@ -160,6 +160,13 @@
     return settings.value("hgbinary", "").toString();
 }
 
+QString HgRunner::getSshBinaryName()
+{
+    QSettings settings;
+    settings.beginGroup("Locations");
+    return settings.value("sshbinary", "").toString();
+}
+
 QString HgRunner::getExtensionLocation()
 {
     QSettings settings;
@@ -397,6 +404,13 @@
     if (executable == "") {
         // This is a Hg command
         executable = getHgBinaryName();
+        if (executable == "") executable = "hg";
+
+        QString ssh = getSshBinaryName();
+        if (ssh != "") {
+            params.push_front(QString("ui.ssh=\"%1\"").arg(ssh));
+            params.push_front("--config");
+        }
 
         if (action.mayBeInteractive()) {
             params.push_front("ui.interactive=true");
@@ -404,7 +418,7 @@
 
             if (settings.value("useextension", true).toBool()) {
                 QString extpath = getExtensionLocation();
-                params.push_front(QString("extensions.easyhg=%1").arg(extpath));
+                params.push_front(QString("extensions.easyhg=\"%1\"").arg(extpath));
                 params.push_front("--config");
             }
             interactive = true;