From bcdca19c376759819f97bbbc38d879f036d17985 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Mon, 22 Dec 2014 14:59:41 +0200 Subject: Output SR for rejected/accepted submissions Ouput of repa list now contains SRs for rejected or accepted submissions in base project. Change-Id: Iac1de4c57c896c28934f50507bdf89e98e9e0181 Signed-off-by: Ed Bartosh --- debian/changelog | 3 ++- packaging/repa.changes | 3 ++- repa/list.py | 19 ++++++++++++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index cdfee25..403323f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,9 @@ repa (0.3) unstable; urgency=low * Reworked repa diff (Fixes: #1869) * Implement --base option for repa list * Pylinted codebase + * Output SR for rejected/accepted submissions - -- Ed Bartosh Sun, 14 Dec 2014 00:10:02 +0200 + -- Ed Bartosh Mon, 22 Dec 2014 15:01:02 +0200 repa (0.2) unstable; urgency=low diff --git a/packaging/repa.changes b/packaging/repa.changes index 1237a5c..ee2d08e 100644 --- a/packaging/repa.changes +++ b/packaging/repa.changes @@ -1,4 +1,4 @@ -* Sun Dec 14 2014 Ed Bartosh 0.3 +* Sun Dec 22 2014 Ed Bartosh 0.3 - group: disable publishing when aggregating packages - Skip conflicting submissions when creating a group - group: Implemented parallel package aggregating (Fixes: #1955) @@ -12,6 +12,7 @@ - Reworked repa diff (Fixes: #1869) - Implement --base option for repa list - Pylinted codebase +- Output SR for rejected/accepted submissions * Wed May 21 2014 Ed Bartosh 0.2 - Implement --processes options for repa list (Fixes: #1762) diff --git a/repa/list.py b/repa/list.py index 98d0223..4a43e18 100755 --- a/repa/list.py +++ b/repa/list.py @@ -84,14 +84,13 @@ def show_urls(meta): print ' obs url: ', obs_url print -def tag_accepted(obs, project, package, tag): - """Check if tag is in comments of accepted SRs.""" - for sreq in obs.get_srs(project, 'accepted', str(package)): +def get_sr(obs, project, package, tag, status): + """Check if tag is in comments of accepted/declined SRs.""" + for sreq in obs.get_srs(project, status, str(package)): descr = sreq[-1] if descr and 'Tag:' in descr: if tag == descr.split('Tag: ')[-1].split()[0]: - return True - return False + return sreq[0] def list_submissions(obs, target, processes, base, is_colorize=False, showurls=False, ignore=''): @@ -117,8 +116,14 @@ def list_submissions(obs, target, processes, base, is_colorize=False, base_status = get_status(base_meta, colorizer, base_build_results, ignore) else: - if tag_accepted(obs, base, projects[0], tag): - base_status = colorizer.green('accepted') + asr = get_sr(obs, base, projects[0], tag, 'accepted') + if asr: + base_status = colorizer.green('accepted. SR %s' % asr) + else: + rsr = get_sr(obs, base, projects[0], tag, 'revoked') + if rsr: + base_status = colorizer.red('rejected. SR %s' % rsr) + print '%-37s %-37s %-37s %s' % (meta['git_tag'], \ get_status(meta, colorizer, build_results, ignore), base_status, ','.join(projects)) -- cgit v1.2.3