Implementation of new methods from SCM class (compareRemoteRevisionWith and calcRevisionsFromBuild). Copied from commit 65bee7e027e57bba3bddaa9dca794dae660cadfd