| OLD | NEW |
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 from threading import Lock, Thread | 5 from threading import Lock, Thread |
| 6 | 6 |
| 7 from common import utils | 7 from common import utils |
| 8 import crash_utils | 8 import crash_utils |
| 9 | 9 |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 def __GenerateBlameEntry(self, repository_parser, stack_frame, | 117 def __GenerateBlameEntry(self, repository_parser, stack_frame, |
| 118 crash_revision, range_start, range_end): | 118 crash_revision, range_start, range_end): |
| 119 """Generates blame list from the arguments.""" | 119 """Generates blame list from the arguments.""" |
| 120 stack_frame_index = stack_frame.index | 120 stack_frame_index = stack_frame.index |
| 121 component_path = stack_frame.component_path | 121 component_path = stack_frame.component_path |
| 122 component_name = stack_frame.component_name | 122 component_name = stack_frame.component_name |
| 123 file_name = stack_frame.file_name | 123 file_name = stack_frame.file_name |
| 124 file_path = stack_frame.file_path | 124 file_path = stack_frame.file_path |
| 125 crashed_line_number = stack_frame.crashed_line_range[0] | 125 crashed_line_number = stack_frame.crashed_line_range[0] |
| 126 | 126 |
| 127 if file_path.startswith(component_path): |
| 128 file_path = file_path[len(component_path):] |
| 129 |
| 127 # Parse blame information. | 130 # Parse blame information. |
| 128 parsed_blame_info = repository_parser.ParseBlameInfo( | 131 parsed_blame_info = repository_parser.ParseBlameInfo( |
| 129 component_path, file_path, crashed_line_number, crash_revision) | 132 component_path, file_path, crashed_line_number, crash_revision) |
| 130 | 133 |
| 131 # If it fails to retrieve information, do not do anything. | 134 # If it fails to retrieve information, do not do anything. |
| 132 if not parsed_blame_info: | 135 if not parsed_blame_info: |
| 133 return | 136 return |
| 134 | 137 |
| 135 # Create blame object from the parsed info and add it to the list. | 138 # Create blame object from the parsed info and add it to the list. |
| 136 (line_content, revision, author, url, message) = parsed_blame_info | 139 (line_content, revision, author, url, message) = parsed_blame_info |
| (...skipping 17 matching lines...) Expand all Loading... |
| 154 if blame.range_start and blame.range_end: | 157 if blame.range_start and blame.range_end: |
| 155 | 158 |
| 156 # Discards results that are after the end of regression. | 159 # Discards results that are after the end of regression. |
| 157 if not utils.IsGitHash(blame.revision) and ( | 160 if not utils.IsGitHash(blame.revision) and ( |
| 158 int(blame.range_end) <= int(blame.revision)): | 161 int(blame.range_end) <= int(blame.revision)): |
| 159 continue | 162 continue |
| 160 | 163 |
| 161 filtered_blame_list.append(blame) | 164 filtered_blame_list.append(blame) |
| 162 | 165 |
| 163 self.blame_list = filtered_blame_list | 166 self.blame_list = filtered_blame_list |
| OLD | NEW |