| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """This file contains printing-related functionality of the bisect.""" | 5 """This file contains printing-related functionality of the bisect.""" |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 from bisect_results import BisectResults | 10 from bisect_results import BisectResults |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 Test Metric: %(metrics)s | 23 Test Metric: %(metrics)s |
| 24 Relative Change: %(change)s | 24 Relative Change: %(change)s |
| 25 Estimated Confidence: %(confidence).02f%%""" | 25 Estimated Confidence: %(confidence).02f%%""" |
| 26 | 26 |
| 27 # The perf dashboard specifically looks for the string | 27 # The perf dashboard specifically looks for the string |
| 28 # "Author : " to parse out who to cc on a bug. If you change the | 28 # "Author : " to parse out who to cc on a bug. If you change the |
| 29 # formatting here, please update the perf dashboard as well. | 29 # formatting here, please update the perf dashboard as well. |
| 30 RESULTS_REVISION_INFO = """ | 30 RESULTS_REVISION_INFO = """ |
| 31 ===== SUSPECTED CL(s) ===== | 31 ===== SUSPECTED CL(s) ===== |
| 32 Subject : %(subject)s | 32 Subject : %(subject)s |
| 33 Author : %(author)s%(email_info)s%(commit_info)s | 33 Author : %(author)s%(commit_info)s |
| 34 Commit : %(cl)s | 34 Commit : %(cl)s |
| 35 Date : %(cl_date)s""" | 35 Date : %(cl_date)s""" |
| 36 | 36 |
| 37 RESULTS_THANKYOU = """ | 37 RESULTS_THANKYOU = """ |
| 38 | O O | Visit http://www.chromium.org/developers/core-principles for Chrome's | 38 | O O | Visit http://www.chromium.org/developers/core-principles for Chrome's |
| 39 | X | policy on perf regressions. Contact chrome-perf-dashboard-team with any | 39 | X | policy on perf regressions. Contact chrome-perf-dashboard-team with any |
| 40 | / \ | questions or suggestions about bisecting. THANK YOU.""" | 40 | / \ | questions or suggestions about bisecting. THANK YOU.""" |
| 41 | 41 |
| 42 REPRO_STEPS_LOCAL = """ | 42 REPRO_STEPS_LOCAL = """ |
| 43 ==== INSTRUCTIONS TO REPRODUCE ==== | 43 ==== INSTRUCTIONS TO REPRODUCE ==== |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 # Format is "git-svn-id: svn://....@123456 <other data>" | 173 # Format is "git-svn-id: svn://....@123456 <other data>" |
| 174 svn_line = [i for i in info['body'].splitlines() if 'git-svn-id:' in i] | 174 svn_line = [i for i in info['body'].splitlines() if 'git-svn-id:' in i] |
| 175 svn_revision = svn_line[0].split('@') | 175 svn_revision = svn_line[0].split('@') |
| 176 svn_revision = svn_revision[1].split(' ')[0] | 176 svn_revision = svn_revision[1].split(' ')[0] |
| 177 return bisect_utils.DEPOT_DEPS_NAME[depot]['viewvc'] + svn_revision | 177 return bisect_utils.DEPOT_DEPS_NAME[depot]['viewvc'] + svn_revision |
| 178 except IndexError: | 178 except IndexError: |
| 179 return '' | 179 return '' |
| 180 return '' | 180 return '' |
| 181 | 181 |
| 182 def _PrintRevisionInfo(self, cl, info, depot=None): | 182 def _PrintRevisionInfo(self, cl, info, depot=None): |
| 183 email_info = '' | |
| 184 if not info['email'].startswith(info['author']): | |
| 185 email_info = '\nEmail : %s' % info['email'] | |
| 186 commit_link = self._GetViewVCLinkFromDepotAndHash(cl, depot) | 183 commit_link = self._GetViewVCLinkFromDepotAndHash(cl, depot) |
| 187 if commit_link: | 184 if commit_link: |
| 188 commit_info = '\nLink : %s' % commit_link | 185 commit_info = '\nLink : %s' % commit_link |
| 189 else: | 186 else: |
| 190 commit_info = ('\nFailed to parse SVN revision from body:\n%s' % | 187 commit_info = ('\nFailed to parse SVN revision from body:\n%s' % |
| 191 info['body']) | 188 info['body']) |
| 192 print RESULTS_REVISION_INFO % { | 189 print RESULTS_REVISION_INFO % { |
| 193 'subject': info['subject'], | 190 'subject': info['subject'], |
| 194 'author': info['author'], | 191 'author': info['email'], |
| 195 'email_info': email_info, | |
| 196 'commit_info': commit_info, | 192 'commit_info': commit_info, |
| 197 'cl': cl, | 193 'cl': cl, |
| 198 'cl_date': info['date'] | 194 'cl_date': info['date'] |
| 199 } | 195 } |
| 200 | 196 |
| 201 @staticmethod | 197 @staticmethod |
| 202 def _PrintTableRow(column_widths, row_data): | 198 def _PrintTableRow(column_widths, row_data): |
| 203 """Prints out a row in a formatted table that has columns aligned. | 199 """Prints out a row in a formatted table that has columns aligned. |
| 204 | 200 |
| 205 Args: | 201 Args: |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 379 |
| 384 @staticmethod | 380 @staticmethod |
| 385 def _PrintWarnings(warnings): | 381 def _PrintWarnings(warnings): |
| 386 """Prints a list of warning strings if there are any.""" | 382 """Prints a list of warning strings if there are any.""" |
| 387 if not warnings: | 383 if not warnings: |
| 388 return | 384 return |
| 389 print | 385 print |
| 390 print 'WARNINGS:' | 386 print 'WARNINGS:' |
| 391 for w in set(warnings): | 387 for w in set(warnings): |
| 392 print ' ! %s' % w | 388 print ' ! %s' % w |
| OLD | NEW |