{"thread":{"id":"3141","subject":"[PATCH] stg export: check if there are any patches to export","startedAt":"2006-01-24T21:25:41Z","lastAt":"2006-01-24T21:25:41Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"15092","messageId":"1138137941.24415.33.camel@dv","threadId":"3141","inReplyTo":null,"subject":"[PATCH] stg export: check if there are any patches to export","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-01-24T21:25:41Z","receivedAt":"2006-01-24T21:25:41Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Otherwise, stg export fails with \"list index out of range\"\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/commands/export.py |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/stgit/commands/export.py b/stgit/commands/export.py\nindex 096fb68..b8ca133 100644\n--- a/stgit/commands/export.py\n+++ b/stgit/commands/export.py\n@@ -124,6 +124,9 @@ def func(parser, options, args):\n     patches = applied[start_idx:stop_idx]\n \n     num = len(patches)\n+    if num == 0:\n+        raise CmdException, 'No patches applied'\n+\n     zpadding = len(str(num))\n     if zpadding < 2:\n         zpadding = 2\n\n\n-- \nRegards,\nPavel Roskin\n"}]}