Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(687)

Side by Side Diff: tools/findit/blame.py

Issue 510163002: [Findit] Fix blame for GIT and uptake bug fix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reupload Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/findit/chromium_deps.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | tools/findit/chromium_deps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698