+ crt_series.delete_patch(patch)
+ del applied[patch]
+ print 'Patch "%s" successfully deleted' % patch
+
+ for patch in unapplied.iterkeys():
+ crt_series.delete_patch(patch)
+ print 'Patch "%s" successfully deleted' % patch
+
+ if applied:
+ print 'Error: failed to delete %s' % ', '.join(applied.iterkeys())
+
+ failed = len(applied)
+ if failed:
+ raise CmdException, 'Failed to delete %d patches' % failed