add -a, --print-all option to pisi blame: Blame for all of the releases.

This commit is contained in:
Serdar Dalgıç
2009-12-16 13:23:59 +00:00
parent 27e8a704c5
commit e0b7d1188f
+6 -1
View File
@@ -39,6 +39,8 @@ Usage: blame <package> ... <package>
def options(self):
group = optparse.OptionGroup(self.parser, _("blame options"))
group.add_option("-r", "--release", action="store", type="int", help=_("Blame for the given release"))
group.add_option("-a", "--print-all", action="store_true", default=False,
help=_("Blame for all of the releases"))
self.parser.add_option_group(group)
def run(self):
@@ -52,8 +54,11 @@ Usage: blame <package> ... <package>
if self.packagedb.has_package(package):
pkg = self.packagedb.get_package(package)
release = ctx.get_option('release')
if not release:
if not release and not ctx.get_option('print_all'):
self.print_package_info(pkg)
elif ctx.get_option('print_all'):
for hno, update in enumerate(pkg.history):
self.print_package_info(pkg, hno)
else:
for hno, update in enumerate(pkg.history):
if int(update.release) == release: