If a person does not believe they are wrong (i.e. that they are righteous) then they will not repent. When a person realizes they are wrong, they will repent.