fix hg parsing