Contains in branches feature implemented for mercurial log.

*test added
scope to check for cheap search (IDEA-117665)
clean up imports
remember different working dirs for rerun (IDEA-116110)
Method name simplified
Gradle: fix to avoid simultaneous  project refresh
optimization — check isEmpty
wait smart mode checks for isReadAccessAllowed too, so, we must not call it