Orientational epitaxy of a wall near the commensurate-incommensurate phase transition