def create(self, patchname):
patch = Patch(patchname)<EOL>if self.series.is_patch(patch):<EOL><INDENT>raise PatchAlreadyExists(self.series, patchname)<EOL><DEDENT>patch_dir = self.quilt_patches<EOL>patch_dir.create()<EOL>patchfile = patch_dir + File(patchname)<EOL>patchfile.touch()<EOL>pc_dir = self.quilt_pc + patchname<EOL>if pc_dir.exists():<EOL><INDENT>pc_dir.delete()<EOL><DEDENT>pc_dir.create()<EOL>top = self.db.top_patch()<EOL>self.series.add_patches([patch], top)<EOL>self.db.add_patch(patch)<EOL>self.series.save()<EOL>self.db.save()<EOL>self.patch_created(patch)<EOL>
Adds a new patch with patchname to the queue

        The new patch will be added as the topmost applied patch.