Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import logging | 5 import logging |
| 6 from collections import defaultdict | 6 from collections import defaultdict |
| 7 from collections import namedtuple | 7 from collections import namedtuple |
| 8 | 8 |
| 9 from common.chrome_dependency_fetcher import ChromeDependencyFetcher | 9 from common.chrome_dependency_fetcher import ChromeDependencyFetcher |
| 10 from crash import crash_util | 10 from crash import crash_util |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 }), | 192 }), |
| 193 ] | 193 ] |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 reverted_cls (set): A set of reverted revisions. | 197 reverted_cls (set): A set of reverted revisions. |
| 198 """ | 198 """ |
| 199 dep_to_file_to_changelogs = defaultdict(lambda: defaultdict(list)) | 199 dep_to_file_to_changelogs = defaultdict(lambda: defaultdict(list)) |
| 200 reverted_cls = set() | 200 reverted_cls = set() |
| 201 | 201 |
| 202 for dep in stack_deps: | 202 for dep in stack_deps or []: |
|
Martin Barbella
2017/02/06 21:16:12
At a glance it seems like it'd be cleaner to ensur
Sharu Jiang
2017/02/10 22:07:20
Done.
| |
| 203 # If a dep is not in regression range, than it cannot be the dep of | 203 # If a dep is not in regression range, than it cannot be the dep of |
| 204 # culprits. | 204 # culprits. |
| 205 dep_roll = regression_deps_rolls.get(dep) | 205 dep_roll = regression_deps_rolls.get(dep) |
| 206 if not dep_roll: | 206 if not dep_roll: |
| 207 continue | 207 continue |
| 208 | 208 |
| 209 repository = get_repository(dep_roll.repo_url) | 209 repository = get_repository(dep_roll.repo_url) |
| 210 changelogs = repository.GetChangeLogs(dep_roll.old_revision, | 210 changelogs = repository.GetChangeLogs(dep_roll.old_revision, |
| 211 dep_roll.new_revision) | 211 dep_roll.new_revision) |
| 212 | 212 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 repository = get_repository(stack_deps[dep].repo_url) | 305 repository = get_repository(stack_deps[dep].repo_url) |
| 306 blame = repository.GetBlame(touched_file_path, | 306 blame = repository.GetBlame(touched_file_path, |
| 307 stack_deps[dep].revision) | 307 stack_deps[dep].revision) |
| 308 | 308 |
| 309 # Generate/update each suspect(changelog) in changelogs, blame is used | 309 # Generate/update each suspect(changelog) in changelogs, blame is used |
| 310 # to calculate distance between touched lines and crashed lines in file. | 310 # to calculate distance between touched lines and crashed lines in file. |
| 311 suspects.GenerateSuspects( | 311 suspects.GenerateSuspects( |
| 312 touched_file_path, dep, stack_infos, changelogs, blame) | 312 touched_file_path, dep, stack_infos, changelogs, blame) |
| 313 | 313 |
| 314 return suspects.values() | 314 return suspects.values() |
| OLD | NEW |