diff hgrunner.cpp @ 340:bb189827f6d1

Disable "Show All Files" when there's no repo; refuse to run Hg commands without working dir; increase first-start window size a bit
author Chris Cannam
date Tue, 15 Mar 2011 12:00:31 +0000
parents dff8ec43c86d
children
line wrap: on
line diff
--- a/hgrunner.cpp	Tue Mar 15 11:45:53 2011 +0000
+++ b/hgrunner.cpp	Tue Mar 15 12:00:31 2011 +0000
@@ -381,6 +381,12 @@
     bool interactive = false;
     QStringList params = action.params;
 
+    if (action.workingDir.isEmpty()) {
+        // We require a working directory, never just operate in pwd
+        emit commandFailed(action, "EasyMercurial: No working directory supplied, will not run Mercurial command without one");
+        return;
+    }
+
     QSettings settings;
     settings.beginGroup("General");
 
@@ -443,9 +449,7 @@
     connect(m_proc, SIGNAL(readyReadStandardError()),
             this, SLOT(dataReadyStderr()));
 
-    if (!action.workingDir.isEmpty()) {
-        m_proc->setWorkingDirectory(action.workingDir);
-    }
+    m_proc->setWorkingDirectory(action.workingDir);
 
     if (interactive) {
         openTerminal();