Sped up hg prompt parsing