# # # patch "NEWS" # from [09aa8102c6720729211af155002349be28690a97] # to [fedab0b6110210fd90efd17b7d63621b6449f7e5] # # patch "src/monotone/MonotoneManager.cpp" # from [d086c0811b629da1e0a5cecbe90fb3c03cc8dafe] # to [eda6f3d76cf103d4010ae438de9bce264fcc5ab7] # # patch "src/monotone/MonotoneManager.h" # from [84e8236e6576ec4b8a1c2437299b32c7089265c5] # to [b4a9459422a691cacecc9ca8545753c49ca41df1] # ============================================================ --- NEWS 09aa8102c6720729211af155002349be28690a97 +++ NEWS fedab0b6110210fd90efd17b7d63621b6449f7e5 @@ -21,6 +21,8 @@ huge workloads (f.e. big chunks of inventory output) - improved: starting with mtn 0.39 incremental workspace loading is enabled by default + - bugfix: a running mtn instance for a workspace is now properly re-used if + needed for a database-only task - bugfix: if a not supported mtn version is found and the user hits cancel in the preferences dialog, guitone is now closed properly and does not sit in the background doing nothing ============================================================ --- src/monotone/MonotoneManager.cpp d086c0811b629da1e0a5cecbe90fb3c03cc8dafe +++ src/monotone/MonotoneManager.cpp eda6f3d76cf103d4010ae438de9bce264fcc5ab7 @@ -97,8 +97,6 @@ MonotoneThread * MonotoneManager::getThr return getThread(database, QString()); } -// FIXME: if there is already a thread "path/to/db.mtn|path/to/workspace" running, -// re-use this if we get at request for "path/to/db.mtn|" MonotoneThread * MonotoneManager::getThread(const DatabaseFile & database, const WorkspacePath & workspace) { QMutexLocker locker(&lock); @@ -109,8 +107,7 @@ MonotoneThread * MonotoneManager::getThr // since we cannot set the workspace directory after we've // started the process, we need to ensure that each workspace runs with // its own process - QString ident = database + "|" + workspace; - QList threadIDs = identMap.keys(ident); + QList threadIDs = identMap.keys(database + "|" + workspace); if (threadIDs.size() == 0) { @@ -120,7 +117,11 @@ MonotoneThread * MonotoneManager::getThr new MonotoneThread(threadNumber, mtnPath, database, workspace); threadMap.insert(threadNumber, thread); - identMap.insert(threadNumber, ident); + identMap.insert(threadNumber, database + "|"); + if (!workspace.isEmpty()) + { + identMap.insert(threadNumber, database + "|" + workspace); + } threadIDs.append(threadNumber); static bool processErrorRegisteredMetaType = false; ============================================================ --- src/monotone/MonotoneManager.h 84e8236e6576ec4b8a1c2437299b32c7089265c5 +++ src/monotone/MonotoneManager.h b4a9459422a691cacecc9ca8545753c49ca41df1 @@ -21,6 +21,8 @@ #include "MonotoneThread.h" +#include + class MonotoneManager : public QObject { Q_OBJECT @@ -64,7 +66,7 @@ private: MonotoneThread * getThread(const DatabaseFile &, const WorkspacePath &); QMap threadMap; - QMap identMap; + QMultiMap identMap; QMap workspaceMap; QString mtnPath;