Previously I have described my solution for subrepos in Mercurial. It was working nicely but, a little painfully, because you had to add every single Mercurial command you like to use as Rake task. After little googleing and scratching head I have come with a much nicer and general solution:
It is shorter and any command may be used, with any parameters, like:
and so on. Enjoy!