+ global crt_series
+
+ if options.all and options.short:
+ raise CmdException, 'combining --all and --short is meaningless'
+
+ # current series patches
+ if options.invisible:
+ applied = unapplied = []
+ hidden = crt_series.get_hidden()
+ elif options.all:
+ applied = crt_series.get_applied()
+ unapplied = crt_series.get_unapplied()
+ hidden = crt_series.get_hidden()
+ else:
+ applied = crt_series.get_applied()
+ unapplied = crt_series.get_unapplied()
+ hidden = []
+
+ if options.missing:
+ # switch the series, the one specified with --missing should
+ # become the current
+ cmp_series = crt_series
+ crt_series = stack.Series(options.missing)
+ stgit.commands.common.crt_series = crt_series
+
+ cmp_patches = applied + unapplied + hidden
+
+ # new current series patches
+ if options.invisible:
+ applied = unapplied = []
+ hidden = crt_series.get_hidden()
+ elif options.all:
+ applied = crt_series.get_applied()
+ unapplied = crt_series.get_unapplied()
+ hidden = crt_series.get_hidden()
+ else:
+ applied = crt_series.get_applied()
+ unapplied = crt_series.get_unapplied()
+ hidden = []
+ else:
+ cmp_patches = []
+
+ # the filtering range covers the whole series
+ if args:
+ show_patches = parse_patches(args, applied + unapplied + hidden,
+ len(applied))
+ else:
+ show_patches = applied + unapplied + hidden
+
+ # missing filtering
+ show_patches = [p for p in show_patches if p not in cmp_patches]