when does currentBuild.changeSets in Jenkins gets filled? Some background: The project I'm working on is in SVN. Very very large. A lot of tests are running on Jenkins. I want to implement a new tests which should be executed only if files in certain directory have been changed.

The idea that I had was:


to trigger the job using a pollSCM every ten minutes
check the files in currentBuild.changeSets. If a file contains the directory, continue.
Only then I do a full checkout of the repository, compile, and run the tests.


But before I write the code, I was wondering when does  currentBuild.changeSets? Will it have the required information when triggered by a pollSCM? I could not find this in the documentation

Yes, this could be done in a better way using git and hooks and other tools but that's what I have right now.
It will be set after any checkout steps (or derivatives of checkout such as git or svn).

So for instance:

println(currentBuild.changeSets) // should print an empty set

checkout(scm)

println(currentBuild.changeSets) // should print out any changes in the current build