Merged revision(s) r23115, r23123, , r23125, r23126, r23127 from trunk:
* Avoid problems with compiler optimizations: declare the variable before the condition so the value isn't discarded too early.
* In case creating the client context fails, check for the invalid context and in case it's invalid, make sure the path gets crawled again. (Fixes issue #383) : access violation if context creation fails
* When removing log caches back-to-front, we may remove more than one entry at a time (i.e. if root + UUID match multiple entries). Instead of using iterators, we must use verifiable direct indexes. (Fixes issue #384) : Crash when removing old log caches
* Treat replacements just like adds when determining whether and where to continue the log. (Fixes issue #385) : Log cache not filled after REPLACE
* * teach build scripts to automatically create config.bat and default.build.user if they are not present * make config.bat.sample slightly more generic