OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 datetime | 5 import datetime |
6 import dateutil.parser | 6 import dateutil.parser |
7 import pytz | 7 import pytz |
8 import re | 8 import re |
9 import subprocess | 9 import subprocess |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 tbr = [x.strip().split('@')[0] for x in tbr.split(',')] | 72 tbr = [x.strip().split('@')[0] for x in tbr.split(',')] |
73 else: | 73 else: |
74 tbr = ['NOBODY'] | 74 tbr = ['NOBODY'] |
75 return tbr | 75 return tbr |
76 | 76 |
77 | 77 |
78 # TODO(keelerh): scan all review urls in a commit and compare the diffs to | 78 # TODO(keelerh): scan all review urls in a commit and compare the diffs to |
79 # identify the correct one | 79 # identify the correct one |
80 def get_review_url(git_line): | 80 def get_review_url(git_line): |
81 review_url = None | 81 review_url = None |
82 if re.match(r'^Review:.+$', git_line): | 82 if re.match(r'^Review: .+$', git_line): |
83 review_url = git_line[8:] | 83 review_url = git_line[8:] |
84 elif re.match(r'^Review URL:.+$', git_line): | 84 elif re.match(r'^Review URL: .+$', git_line): |
85 review_url = git_line[12:] | 85 review_url = git_line[12:] |
86 elif re.match(r'^Code review URL:.+$', git_line): | 86 elif re.match(r'^Code review URL: .+$', git_line): |
87 review_url = git_line[17:] | 87 review_url = git_line[17:] |
| 88 elif re.match(r'^Reviewed-on: .+$', git_line): |
| 89 review_url = git_line[13:] |
88 return review_url | 90 return review_url |
89 | 91 |
90 | 92 |
91 def get_features_for_git_commit(git_commit): | 93 def get_features_for_git_commit(git_commit): |
92 """Retrieves the git commit features | 94 """Retrieves the git commit features |
93 | 95 |
94 Arg: | 96 Arg: |
95 git_commit(dict): a commit message parsed into a dictionary | 97 git_commit(dict): a commit message parsed into a dictionary |
96 | 98 |
97 Return: | 99 Return: |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 WHERE type='tbr' | 203 WHERE type='tbr' |
202 GROUP BY git_commit_hash) tbr_count | 204 GROUP BY git_commit_hash) tbr_count |
203 ON commit_people.git_commit_hash = tbr_count.git_commit_hash | 205 ON commit_people.git_commit_hash = tbr_count.git_commit_hash |
204 INNER JOIN git_commit | 206 INNER JOIN git_commit |
205 ON commit_people.git_commit_hash = git_commit.hash | 207 ON commit_people.git_commit_hash = git_commit.hash |
206 WHERE tbr_count.c <> 0 | 208 WHERE tbr_count.c <> 0 |
207 AND git_commit.review_url IS NOT NULL | 209 AND git_commit.review_url IS NOT NULL |
208 AND commit_people.type='author'""") | 210 AND commit_people.type='author'""") |
209 commits_with_review_urls = cc.fetchall() | 211 commits_with_review_urls = cc.fetchall() |
210 return [x[0] for x in commits_with_review_urls] | 212 return [x[0] for x in commits_with_review_urls] |
OLD | NEW |