hgext: make "review requests lack reviewers" more noticable (bug 1271494); r?gps draft
authorbyron jones <glob@mozilla.com>
Tue, 10 May 2016 23:12:11 +0800
changeset 8094 b4b4c7ac12e03ce7bfda6b67ffc24c6bf8540344
parent 8093 96fe375e09d3d988d8ebcbcb572c6548e053c54f
push id820
push userbjones@mozilla.com
push dateThu, 12 May 2016 04:53:09 +0000
reviewersgps
bugs1271494
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
hgext/reviewboard/client.py
--- 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.