hgext: make "review requests lack reviewers" more noticable (
bug 1271494); r?gps
In order to make it stand out, reclassify the "review requests lack reviewers"
message as a warning, and ensure a colour for warnings is defined.
MozReview-Commit-ID: BXY7nh6P7X2
--- a/hgext/reviewboard/client.py
+++ b/hgext/reviewboard/client.py
@@ -476,16 +476,24 @@ def doreview(repo, ui, remote, nodes):
"""Do the work of submitting a review to a remote repo.
:remote is a peerrepository.
:nodes is a list of nodes to review.
"""
assert nodes
assert 'pushreview' in getreviewcaps(remote)
+ # Ensure a color for ui.warning is defined.
+ try:
+ color = extensions.find('color')
+ if 'ui.warning' not in color._styles:
+ color._styles['ui.warning'] = 'red'
+ except Exception:
+ pass
+
bzauth = getbugzillaauth(ui)
if not bzauth:
ui.warn(_('Bugzilla credentials not available. Not submitting review.\n'))
return
identifier = None
# The review identifier can come from a number of places. In order of
@@ -624,18 +632,19 @@ def doreview(repo, ui, remote, nodes):
ui.write(' (draft)')
ui.write('\n')
# Warn people that they have not assigned reviewers for at least some
# of their commits.
for node in nodes:
rd = reviewdata[nodereviews[node]]
if not rd.get('reviewers', None):
- ui.status(_('(review requests lack reviewers; visit review url '
- 'to assign reviewers)\n'))
+ ui.write('\n')
+ ui.warn(_('(review requests lack reviewers; visit review url '
+ 'to assign reviewers)\n'))
break
# Make it clear to the user that they need to take action in order for
# others to see this review series.
if havedraft:
# If there is no configuration value specified for
# reviewboard.autopublish, prompt the user. Otherwise, publish
# automatically or not based on this value.