From: Chuck Lever Date: Wed, 2 Nov 2005 21:55:37 +0000 (-0500) Subject: "stg export" error message could be more specific X-Git-Tag: v0.8~33 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/4dcb1859c57d4b5c70bb28d01ebdca6147718a16 "stg export" error message could be more specific Like similar previous patches, make "stg export" distinguish between an unapplied patch and a non-existent one when reporting a failure. Signed-off-by: Chuck Lever --- diff --git a/stgit/commands/export.py b/stgit/commands/export.py index c04ecc5..58a3965 100644 --- a/stgit/commands/export.py +++ b/stgit/commands/export.py @@ -99,11 +99,18 @@ def func(parser, options, args): 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: - 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'