Use Git and Mercurial inbuilt commands to apply patch. Fixes #2563
Merge branch 'bug2563' of git://github.com/srinupiits/buildbot