When you do your first Sonar run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture.
Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using Mercurial as a version system as well, this is your day. :)
In the Sonar Advanced Parameter documentation you will find a System Property called sonar.projectDate. The property let you tell Sonar when in time the running analysis was ran.
By combining this property and what your version system does best, track changes to source, we can now play back the history of the project as far as Sonar is concerned.
This little Bash script illustrates the concept. To spell out what it does in human readable form: