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

Unified Diff: tools/findit/match_set.py

Issue 478763003: [Findit] Bug fixing and implemented some feature requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a bug in intersection Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: tools/findit/match_set.py
diff --git a/tools/findit/match_set.py b/tools/findit/match_set.py
index a22d0ef5303b01e541265c83b54cc2fe75bed271..2d75f8f2cf1be95c32b026c438f7a78cf1239a63 100644
--- a/tools/findit/match_set.py
+++ b/tools/findit/match_set.py
@@ -10,7 +10,7 @@ from threading import Lock
import crash_utils
-REVIEW_URL_PATTERN = re.compile(r'Review URL:( *)(.*)')
+REVIEW_URL_PATTERN = re.compile(r'Review URL:( *)(.*?)/(\d+)')
class Match(object):
@@ -20,7 +20,7 @@ class Match(object):
contains information about files it changes, their authors, etc.
Attributes:
- is_reverted: True if this CL is reverted by other CL.
+ is_revert: True if this CL is reverted by other CL.
revert_of: If this CL is a revert of some other CL, a revision number/
git hash of that CL.
crashed_line_numbers: The list of lines that caused crash for this CL.
@@ -33,9 +33,6 @@ class Match(object):
component_name: The name of the component that this CL belongs to.
stack_frame_indices: For files that caused crash, list of where in the
stackframe they occur.
- rank: The highest priority among the files the CL changes. Priority = 1
- if it changes the crashed line, and priority = 2 if it is a simple
- file change.
priorities: A list of priorities for each of the changed file.
stgao 2014/08/22 06:50:54 Please add a description on how priority is define
jeun 2014/08/22 22:58:44 Done.
reivision_url: The revision URL of the CL.
review_url: The codereview URL that reviews this CL.
@@ -45,8 +42,9 @@ class Match(object):
REVERT_PATTERN = re.compile(r'(revert\w*) r?(\d+)', re.I)
def __init__(self, revision, component_name):
- self.is_reverted = False
+ self.is_revert = False
self.revert_of = None
+ self.message = None
self.crashed_line_numbers = []
self.function_list = []
self.min_distance = crash_utils.INFINITY
@@ -55,7 +53,6 @@ class Match(object):
self.author = revision['author']
self.component_name = component_name
self.stack_frame_indices = []
- self.rank = crash_utils.INFINITY
self.priorities = []
self.revision_url = revision['url']
self.review_url = ''
@@ -72,6 +69,7 @@ class Match(object):
message: The message to parse.
codereview_api_url: URL to retrieve codereview data from.
"""
+ self.message = message
for line in message.splitlines():
line = line.strip()
review_url_line_match = REVIEW_URL_PATTERN.match(line)
@@ -80,7 +78,7 @@ class Match(object):
if review_url_line_match:
# Get review number for the code review site from the line.
- issue_number = review_url_line_match.group(2)
+ issue_number = review_url_line_match.group(3)
# Get JSON from the code review site, ignore the line if it fails.
url = codereview_api_url % issue_number
@@ -97,7 +95,7 @@ class Match(object):
# Check if this CL is a revert of other CL.
if line.lower().startswith('revert'):
- self.is_reverted = True
+ self.is_revert = True
# Check if the line says what CL this CL is a revert of.
revert = self.REVERT_PATTERN.match(line)

Powered by Google App Engine
This is Rietveld 408576698