- applied = crt_series.get_applied()
-
- if options.range:
- boundaries = options.range.split(':')
- if len(boundaries) == 1:
- start = boundaries[0]
- stop = boundaries[0]
- elif len(boundaries) == 2:
- if boundaries[0] == '':
- start = applied[0]
- else:
- start = boundaries[0]
- if boundaries[1] == '':
- stop = applied[-1]
- else:
- stop = boundaries[1]
- else:
- raise CmdException, 'incorrect parameters to "--range"'
-
- if start in applied:
- start_idx = applied.index(start)
- else:
- raise CmdException, 'Patch "%s" not applied' % start
- if stop in applied:
- stop_idx = applied.index(stop) + 1
- else:
- raise CmdException, 'Patch "%s" not applied' % stop
+ if not options.stdout:
+ if not os.path.isdir(dirname):
+ os.makedirs(dirname)
+ series = file(os.path.join(dirname, 'series'), 'w+')