# # # patch "src/monotone/MonotoneThread.cpp" # from [fde2557e39098eb7ea87b7b84fb529be715b3ee8] # to [f154d92526f62d1503a061aaff91335c6f301cc5] # ============================================================ --- src/monotone/MonotoneThread.cpp fde2557e39098eb7ea87b7b84fb529be715b3ee8 +++ src/monotone/MonotoneThread.cpp f154d92526f62d1503a061aaff91335c6f301cc5 @@ -164,11 +164,32 @@ void MonotoneThread::run() args << QString("--automate-stdio-size=%1").arg(StdioBufferSize); args << "--db" << databasePath; + // check whether we need to work on a specific workspace directory or not if (!workspacePath.isEmpty()) { process->setWorkingDirectory(workspacePath); } + else + { + // we need to ensure that the current directory is no workspace + // directory, so paths won't get interpreted wrongly + QString tmpPath = QDir::tempPath(); + if (QDir(tmpPath + "/_MTN").exists()) + { + // this is actually not a QProcess error, but who cares... + emit aborted(threadNumber, QProcess::UnknownError, + tr("The temporary directory '%1' contains a monotone " + "workspace, which may lead to serious path resolution " + "errors on execution. Its recommended you remove " + "this workspace before you retry this again!").arg(tmpPath)); + // the process hasn't yet been started, so we don't need to + // clean it up + return; + } + process->setWorkingDirectory(tmpPath); + } + L(QString("starting %1 %2").arg(mtnBinary).arg(args.join(" "))); process->start(mtnBinary, args);