def replace(self, old_patch, new_patch):
self._check_patch(old_patch)<EOL>old_patchline = self.patch2line[old_patch]<EOL>index = self.patchlines.index(old_patchline)<EOL>self.patchlines.pop(index)<EOL>new_patchline = PatchLine(new_patch)<EOL>new_patchline.set_comment(old_patchline.get_comment())<EOL>self.patchlines.insert(index, new_patchline)<EOL>del self.patch2line[old_patch]<EOL>self.patch2line[new_patch] = new_patchline<EOL>
Replace old_patch with new_patch
        The method only replaces the patch and doesn't change any comments.