OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """A module for the history of the test expectation file.""" | 5 """A module for the history of the test expectation file.""" |
6 | 6 |
| 7 from datetime import datetime |
| 8 from datetime import timedelta |
| 9 |
7 import re | 10 import re |
8 import sys | 11 import sys |
9 import time | 12 import time |
10 import pysvn | 13 import pysvn |
11 | 14 |
12 from datetime import datetime | |
13 from datetime import timedelta | |
14 | |
15 # Default Webkit SVN location for chromium test expectation file. | 15 # Default Webkit SVN location for chromium test expectation file. |
16 # TODO(imasaki): support multiple test expectation files. | 16 # TODO(imasaki): support multiple test expectation files. |
17 DEFAULT_TEST_EXPECTATION_LOCATION = ( | 17 DEFAULT_TEST_EXPECTATION_LOCATION = ( |
18 'http://svn.webkit.org/repository/webkit/trunk/' | 18 'http://svn.webkit.org/repository/webkit/trunk/' |
19 'LayoutTests/platform/chromium/test_expectations.txt') | 19 'LayoutTests/platform/chromium/test_expectations.txt') |
20 | 20 |
21 | 21 |
22 class TestExpectationsHistory: | 22 class TestExpectationsHistory(object): |
23 """A class to represent history of the test expectation file. | 23 """A class to represent history of the test expectation file. |
24 | 24 |
25 The history is obtained by calling PySVN.log()/diff() APIs. | 25 The history is obtained by calling PySVN.log()/diff() APIs. |
26 | 26 |
27 TODO(imasaki): Add more functionalities here like getting some statistics | 27 TODO(imasaki): Add more functionalities here like getting some statistics |
28 about the test expectation file. | 28 about the test expectation file. |
29 """ | 29 """ |
30 | 30 |
31 @staticmethod | 31 @staticmethod |
32 def GetDiffBetweenTimes(start, end, testname_list, | 32 def GetDiffBetweenTimes(start, end, testname_list, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if line[0] == '+' or line[0] == '-': | 98 if line[0] == '+' or line[0] == '-': |
99 target_lines.append(line) | 99 target_lines.append(line) |
100 if target_lines: | 100 if target_lines: |
101 # Needs to convert to normal date string for presentation. | 101 # Needs to convert to normal date string for presentation. |
102 result_list.append(( | 102 result_list.append(( |
103 old_rev, new_rev, logs[i + 1].author, | 103 old_rev, new_rev, logs[i + 1].author, |
104 datetime.fromtimestamp( | 104 datetime.fromtimestamp( |
105 logs[i + 1].date).strftime('%Y-%m-%d %H:%M:%S'), | 105 logs[i + 1].date).strftime('%Y-%m-%d %H:%M:%S'), |
106 logs[i + 1].message, target_lines)) | 106 logs[i + 1].message, target_lines)) |
107 return result_list | 107 return result_list |
OLD | NEW |