OLD | NEW |
---|---|
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 base64 | 5 import base64 |
6 import xml.dom.minidom as minidom | 6 import xml.dom.minidom as minidom |
7 from xml.parsers.expat import ExpatError | 7 from xml.parsers.expat import ExpatError |
8 | 8 |
9 import crash_utils | 9 import crash_utils |
10 from repository_parser_interface import ParserInterface | 10 from repository_parser_interface import ParserInterface |
11 | 11 |
12 FILE_CHANGE_TYPE_MAP = { | 12 FILE_CHANGE_TYPE_MAP = { |
13 'add': 'A', | 13 'add': 'A', |
14 'delete': 'D', | 14 'delete': 'D', |
15 'modify': 'M' | 15 'modify': 'M', |
16 'rename': 'R' | |
16 } | 17 } |
aarya
2014/08/26 02:13:53
I fixed this by guess. I was crashing in rename ke
stgao
2014/08/26 18:35:24
I will check this after lunch.
| |
17 | 18 |
18 | 19 |
19 class GitParser(ParserInterface): | 20 class GitParser(ParserInterface): |
20 """Parser for Git repository in googlesource. | 21 """Parser for Git repository in googlesource. |
21 | 22 |
22 Attributes: | 23 Attributes: |
23 parsed_deps: A map from component path to its repository name, regression, | 24 parsed_deps: A map from component path to its repository name, regression, |
24 etc. | 25 etc. |
25 url_parts_map: A map from url type to its url parts. This parts are added | 26 url_parts_map: A map from url type to its url parts. This parts are added |
26 the base url to form different urls. | 27 the base url to form different urls. |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 revision_url = base_url + revision_url_parts | 273 revision_url = base_url + revision_url_parts |
273 # TODO(jeun): Add a way to get content from JSON object. | 274 # TODO(jeun): Add a way to get content from JSON object. |
274 content = None | 275 content = None |
275 | 276 |
276 (revision_info, _) = self.ParseChangelog(component, revision, revision) | 277 (revision_info, _) = self.ParseChangelog(component, revision, revision) |
277 message = revision_info[revision]['message'] | 278 message = revision_info[revision]['message'] |
278 return (content, revision, author, revision_url, message) | 279 return (content, revision, author, revision_url, message) |
279 | 280 |
280 # Return none if the region does not exist. | 281 # Return none if the region does not exist. |
281 return None | 282 return None |
OLD | NEW |