[hgext] show-review now displays reviewers (closes #287215)

authorJulien Cristau <julien.cristau@logilab.fr>
changesetd982a94e0857
branchdefault
phasepublic
hiddenno
parent revision#50c3cf33bd4d [jobtest] allow TEST_TOOL to be a command with parameters
child revision#ffaacadcdd63 [hgext] add ticket creation command (closes #283529)
files modified by this revision
hgext/jpl/__init__.py
hgext/jpl/review.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1417708093 -3600
# Thu Dec 04 16:48:13 2014 +0100
# Node ID d982a94e0857dfc75f689d71f3a4dad30f907135
# Parent 50c3cf33bd4d749a5855fd3d8541a6804cb3613c
[hgext] show-review now displays reviewers (closes #287215)

diff --git a/hgext/jpl/__init__.py b/hgext/jpl/__init__.py
@@ -291,10 +291,11 @@
1          raise util.Abort(_('no working directory: please specify a revision'))
2      ctxhexs = (node.short(repo.lookup(rev)) for rev in revs)
3 
4      with build_proxy(ui, opts) as client:
5          rev = show_review(client, ctxhexs)
6 -        for pname, uri, status in  rev:
7 +        for pname, uri, status, victims in  rev:
8              ui.write("{0}".format(uri), label='jpl.cwuri')
9 -            ui.write("\t[{0}]\n".format(status), label='jpl.status.{0}'.format(status))
10 +            ui.write("\t[{0}]".format(status), label='jpl.status.{0}'.format(status))
11 +            ui.write("\t{0}\n".format(victims), label='jpl.reviewers')
12              ui.write(pname + '\n\n')
13 
diff --git a/hgext/jpl/review.py b/hgext/jpl/review.py
@@ -16,9 +16,9 @@
14      queries = [builders.build_trinfo(eid[0], 'ask review') for eid in eids]
15      return client.rqlio(queries)
16 
17  def show_review(client, revs):
18      return client.rqlio([(
19 -        '''Any PN, URI, N WHERE P patch_revision R, R changeset IN ({revs}),
20 -             P in_state S, S name N, P cwuri URI, P patch_name PN
21 +        '''Any PN, URI, N, GROUP_CONCAT(L) GROUPBY PN,URI,N WHERE P patch_revision R, R changeset IN ({revs}),
22 +             P in_state S, S name N, P cwuri URI, P patch_name PN, P patch_reviewer U?, U login L
23          '''.format(revs=','.join('%r' % rev for rev in revs)), {}),])[0]
24