# # # patch "guitone/res/i18n/guitone_de.ts" # from [9a5a21b85a73b535ea7c9501604104629f3067a0] # to [5f7e9b9b288e6e1455c3f41b858c05ef82f54c40] # # patch "guitone/src/monotone/Monotone.cpp" # from [45f7336112cf9644ec1ca94cd067c37e08ec3ac7] # to [31361a604f3edb7120e0d751c0fd015f66e9e460] # ============================================================ --- guitone/res/i18n/guitone_de.ts 9a5a21b85a73b535ea7c9501604104629f3067a0 +++ guitone/res/i18n/guitone_de.ts 5f7e9b9b288e6e1455c3f41b858c05ef82f54c40 @@ -949,7 +949,7 @@ monotone gab zurück: %2 - + The monotone process exited unexpectedly (return code %1). Please reconfigure the path to the monotone binary in the Preferences dialog or check if the version of the database you try to load matches the monotone version you are using. monotone returned: ============================================================ --- guitone/src/monotone/Monotone.cpp 45f7336112cf9644ec1ca94cd067c37e08ec3ac7 +++ guitone/src/monotone/Monotone.cpp 31361a604f3edb7120e0d751c0fd015f66e9e460 @@ -36,34 +36,24 @@ // triggerCommand() executeCommand() // | | // V V -// setupNewCommand() setupNewCommand() -// | | -// V V // writeStdin() writeStdin() -// | | +// ... | // ... V -// (wait for signalling) readAndParseStdout() +// wait for signalling, readAndParseStdout() and put it into the +// output map (mapped by command number) - if we receive an "end +// command" token, signal that the next command has been finished // ... | -// | V -// V caller can immediately -// readAndProcessCommand() retrieve the queried output -// | -// V -// readAndParseStdout() -// | -// V -// signal caller that -// command finished +// ... V +// signal the caller catch the signal locally +// to read out the data and immediately return to +// the caller // -// In the synchronous case there also happens a waiting for output, however this -// is done with the SignalWaiter class which triggers the main event loop until -// data become available. -// // Since there is only one instance of the monotone process running at a time, // pending commands need to be queued somehow in order to avoid confusion -// (data are sent to the wrong caller, etc.) - this is done in setupNewCommand(). -// A QMutex hinders a second parallel request on entering the wait loop of a -// previous command. +// (data are sent to the wrong caller, etc.) - this is done by assigning each +// caller a command number by which it can evaluate if the commandFinished() +// signal it just catched was for the command which it triggered or not +// (using isCommandCompleted(commandNumber) // // If a command is about to be executed, its data are written to STDIN of the // running process, whilst encoded into stdio format. @@ -73,8 +63,13 @@ // it at the right time. // // After parsing the output is made available to the calling process by -// get*DataAndReset() - this functions also reset the "processing" flag which -// blocks further attempts to use the stdio communication.. +// get[Raw|Decoded]Data() - these functions also remove the cached data for the +// command so they should always be called, regardless if output is expected +// or even further processed. +// The getReturnCode() method returns the return code for the specified command +// and resets the command as well (isCommandCompleted() then returns false, if +// this is needed at a later time, one could think about keeping this info, +// though it should not make a difference now) // #include "Monotone.h"