summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ebfd015)
Same fix as the recent fixes to "pop" and "push".
Signed-off-by: Chuck Lever <cel@netapp.com>
smtppassword = config.get('stgit', 'smtppassword')
applied = crt_series.get_applied()
smtppassword = config.get('stgit', 'smtppassword')
applied = crt_series.get_applied()
+ unapplied = crt_series.get_unapplied()
if len(args) >= 1:
for patch in args:
if len(args) >= 1:
for patch in args:
- if not patch in applied:
raise CmdException, 'Patch "%s" not applied' % patch
raise CmdException, 'Patch "%s" not applied' % patch
+ if not patch in applied:
+ raise CmdException, 'Patch "%s" does not exist' % patch
+ patches = args
elif options.all:
patches = applied
elif options.range:
elif options.all:
patches = applied
elif options.range:
if start in applied:
start_idx = applied.index(start)
else:
if start in applied:
start_idx = applied.index(start)
else:
- raise CmdException, 'Patch "%s" not applied' % start
+ if start in unapplied:
+ raise CmdException, 'Patch "%s" not applied' % start
+ else:
+ raise CmdException, 'Patch "%s" does not exist' % start
if stop in applied:
stop_idx = applied.index(stop) + 1
else:
if stop in applied:
stop_idx = applied.index(stop) + 1
else:
- raise CmdException, 'Patch "%s" not applied' % stop
+ if stop in unapplied:
+ raise CmdException, 'Patch "%s" not applied' % stop
+ else:
+ raise CmdException, 'Patch "%s" does not exist' % stop
if start_idx >= stop_idx:
raise CmdException, 'Incorrect patch range order'
if start_idx >= stop_idx:
raise CmdException, 'Incorrect patch range order'