| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 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 from collections import namedtuple | 5 from collections import namedtuple |
| 6 | 6 |
| 7 from lib.gitiles.diff import ChangeType | 7 from libs.gitiles.diff import ChangeType |
| 8 | 8 |
| 9 # TODO(wrengr): it'd be better to have a class hierarchy here, so we can | 9 # TODO(wrengr): it'd be better to have a class hierarchy here, so we can |
| 10 # avoid playing around with None, and so the change_type can be stored | 10 # avoid playing around with None, and so the change_type can be stored |
| 11 # once (in the class itself; rather than once per instance). | 11 # once (in the class itself; rather than once per instance). |
| 12 # TODO(http://crbug/644476): better name for this class; i.e., without | 12 # TODO(http://crbug/644476): better name for this class; i.e., without |
| 13 # the extraneous \"Info\" at the very least. | 13 # the extraneous \"Info\" at the very least. |
| 14 # TODO(http://crbug.com/659346): coverage tests for the smart constructors. | 14 # TODO(http://crbug.com/659346): coverage tests for the smart constructors. |
| 15 class FileChangeInfo(namedtuple('FileChangeInfo', | 15 class FileChangeInfo(namedtuple('FileChangeInfo', |
| 16 ['change_type', 'old_path', 'new_path'])): | 16 ['change_type', 'old_path', 'new_path'])): |
| 17 """Represents a file change (add/delete/modify/rename/copy/etc).""" | 17 """Represents a file change (add/delete/modify/rename/copy/etc).""" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 % touched_file_info.__class__.__name__) | 101 % touched_file_info.__class__.__name__) |
| 102 touched_files.append(touched_file_info) | 102 touched_files.append(touched_file_info) |
| 103 | 103 |
| 104 return ChangeLog( | 104 return ChangeLog( |
| 105 info['author_name'], info['author_email'], info['author_time'], | 105 info['author_name'], info['author_email'], info['author_time'], |
| 106 info['committer_name'], info['committer_email'], info['committer_time'], | 106 info['committer_name'], info['committer_email'], info['committer_time'], |
| 107 info['revision'], info['commit_position'], info['message'], | 107 info['revision'], info['commit_position'], info['message'], |
| 108 touched_files, info['commit_url'], info['code_review_url'], | 108 touched_files, info['commit_url'], info['code_review_url'], |
| 109 info['reverted_revision'] | 109 info['reverted_revision'] |
| 110 ) | 110 ) |
| OLD | NEW |