Same thing happened to me at a gig last year,the singer that was mean't to play had to cancel at the last minute and a replacement was brought in,to our joy she knew all the songs on the list but out of 20 numbers 14/15 were in the wrong key for her,after panic had set in for me and the bass player (keyboard player smirking all over his face knowing he had only got to press a few buttons and he was fine)we just thought lets get on with it and hope the crowd lets us out in one piece,transposed the pieces on the fly and it turned out to be a great gig but i was shattered after 2 hours of brain work.
Its amazing what our brain can do if it has to.