- patch = crt_series.get_current()
- if not patch:
- raise CmdException, 'No patches applied'
+ if options.patch:
+ if args:
+ raise CmdException, \
+ 'Only full refresh is available with the --patch option'
+ patch = options.patch
+ if not crt_series.patch_applied(patch):
+ raise CmdException, 'Patches "%s" not applied' % patch
+ else:
+ patch = crt_series.get_current()
+ if not patch:
+ raise CmdException, 'No patches applied'