From 4dcb1859c57d4b5c70bb28d01ebdca6147718a16 Mon Sep 17 00:00:00 2001 Message-Id: <4dcb1859c57d4b5c70bb28d01ebdca6147718a16.1746657900.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 2 Nov 2005 16:55:37 -0500 Subject: [PATCH] "stg export" error message could be more specific Organization: Straylight/Edgeware From: Chuck Lever 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 --- stgit/commands/export.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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' -- [mdw]