stg export: check if there are any patches to export
authorPavel Roskin <proski@gnu.org>
Tue, 24 Jan 2006 21:25:41 +0000 (16:25 -0500)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 25 Jan 2006 21:31:30 +0000 (21:31 +0000)
Otherwise, stg export fails with "list index out of range"

Signed-off-by: Pavel Roskin <proski@gnu.org>
stgit/commands/export.py

index 096fb68..b8ca133 100644 (file)
@@ -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