Update merge script to accept optional revision number