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

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

Issue 617073010: [Findit] Add timestamp of CL commit and fix two bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « tools/findit/crash_utils.py ('k') | tools/findit/git_repository_parser.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 import os 5 import os
6 from threading import Lock 6 from threading import Lock
7 7
8 import blame 8 import blame
9 from common import utils 9 from common import utils
10 import component_dictionary 10 import component_dictionary
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 if cl == cl_combined: 488 if cl == cl_combined:
489 found_match = match_combined 489 found_match = match_combined
490 break 490 break
491 491
492 # If current match is not already in, add it to the list of matches. 492 # If current match is not already in, add it to the list of matches.
493 if not found_match: 493 if not found_match:
494 combined_matches.append((stack_index, cl, match)) 494 combined_matches.append((stack_index, cl, match))
495 continue 495 continue
496 496
497 # Combine the reason if the current match is already in there. 497 # Combine the reason if the current match is already in there.
498 found_match.reason += match.reason 498 found_match.reason += '\n' + match.reason
499 if match.min_distance < found_match.min_distance: 499 if match.min_distance < found_match.min_distance:
500 found_match.min_distance = match.min_distance 500 found_match.min_distance = match.min_distance
501 found_match.min_distance_info = match.min_distance_info 501 found_match.min_distance_info = match.min_distance_info
502 502
503 for stack_index, cl, match in combined_matches: 503 for stack_index, cl, match in combined_matches:
504 if match.min_distance_info: 504 if match.min_distance_info:
505 file_name, min_crashed_line, min_changed_line = match.min_distance_info 505 file_name, min_crashed_line, min_changed_line = match.min_distance_info
506 match.reason += \ 506 match.reason = match.reason.strip()
507 ('\nMinimum distance from crash line to modified line: %d. ' 507 match.reason += (
508 '(file: %s, crashed on: %d, modified: %d).\n' % 508 '\nMinimum distance from crash line to modified line: %d. '
509 (match.min_distance, file_name, min_crashed_line, min_changed_line)) 509 '(file: %s, crashed on: %d, modified: %d).' %
510 (match.min_distance, file_name, min_crashed_line, min_changed_line))
510 511
511 return combined_matches 512 return combined_matches
512 513
513 514
514 def FilterAndGenerateReasonForMatches(result): 515 def FilterAndGenerateReasonForMatches(result):
515 """A wrapper function. 516 """A wrapper function.
516 517
517 It generates reasons for the matches and returns string representation 518 It generates reasons for the matches and returns string representation
518 of filtered results. 519 of filtered results.
519 520
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 'The result is the blame information.') 655 'The result is the blame information.')
655 656
656 # When findit could not find any CL that changes file in stacktrace or if 657 # When findit could not find any CL that changes file in stacktrace or if
657 # if cannot get any blame information, return a message saying that no 658 # if cannot get any blame information, return a message saying that no
658 # results are available. 659 # results are available.
659 else: 660 else:
660 return_message = ('Findit could not find any suspected CLs.') 661 return_message = ('Findit could not find any suspected CLs.')
661 662
662 return (return_message, result) 663 return (return_message, result)
663 664
OLDNEW
« no previous file with comments | « tools/findit/crash_utils.py ('k') | tools/findit/git_repository_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698