Added hgrepo function.