From: Pavel Roskin Date: Tue, 24 Jan 2006 21:25:41 +0000 (-0500) Subject: stg export: check if there are any patches to export X-Git-Tag: v0.9~42 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/16ad223e74aae6fa78ca529e7af7db91097591bf?hp=026c0689b2a70875f48c8933298ef2ae8e4eae7c stg export: check if there are any patches to export Otherwise, stg export fails with "list index out of range" Signed-off-by: Pavel Roskin --- diff --git a/stgit/commands/export.py b/stgit/commands/export.py index 096fb68..b8ca133 100644 --- a/stgit/commands/export.py +++ b/stgit/commands/export.py @@ -124,6 +124,9 @@ def func(parser, options, args): patches = applied[start_idx:stop_idx] num = len(patches) + if num == 0: + raise CmdException, 'No patches applied' + zpadding = len(str(num)) if zpadding < 2: zpadding = 2