| 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 ast | 5 import ast |
| 6 import collections | 6 import collections |
| 7 import contextlib | 7 import contextlib |
| 8 import copy | 8 import copy |
| 9 import difflib | 9 import difflib |
| 10 import functools | 10 import functools |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 self.allow_fetch = allow_fetch | 115 self.allow_fetch = allow_fetch |
| 116 | 116 |
| 117 @classmethod | 117 @classmethod |
| 118 def from_proto_file(cls, repo_root, proto_file, allow_fetch, deps_path=None): | 118 def from_proto_file(cls, repo_root, proto_file, allow_fetch, deps_path=None): |
| 119 buf = proto_file.read() | 119 buf = proto_file.read() |
| 120 | 120 |
| 121 recipes_path = str(buf.recipes_path).replace('/', os.sep) | 121 recipes_path = str(buf.recipes_path).replace('/', os.sep) |
| 122 | 122 |
| 123 if not deps_path: | 123 if not deps_path: |
| 124 deps_path = os.path.join(repo_root, recipes_path, '.recipe_deps') | 124 deps_path = os.path.join(repo_root, recipes_path, '.recipe_deps') |
| 125 |
| 125 return cls(os.path.join(repo_root, recipes_path), | 126 return cls(os.path.join(repo_root, recipes_path), |
| 126 deps_path, | 127 os.path.abspath(deps_path), |
| 127 repo_root, | 128 repo_root, |
| 128 allow_fetch) | 129 allow_fetch) |
| 129 | 130 |
| 130 | 131 |
| 131 class CommitInfo(object): | 132 class CommitInfo(object): |
| 132 """Holds the stuff we need to know about a commit.""" | 133 """Holds the stuff we need to know about a commit.""" |
| 133 def __init__(self, author, message, repo_id, revision): | 134 def __init__(self, author, message, repo_id, revision): |
| 134 self.author = author | 135 self.author = author |
| 135 self.message = message | 136 self.message = message |
| 136 self.repo_id = repo_id | 137 self.repo_id = repo_id |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 >>> d = { 'x': 1, 'y': 2 } | 863 >>> d = { 'x': 1, 'y': 2 } |
| 863 >>> sorted(_updated(d, { 'y': 3, 'z': 4 }).items()) | 864 >>> sorted(_updated(d, { 'y': 3, 'z': 4 }).items()) |
| 864 [('x', 1), ('y', 3), ('z', 4)] | 865 [('x', 1), ('y', 3), ('z', 4)] |
| 865 >>> sorted(d.items()) | 866 >>> sorted(d.items()) |
| 866 [('x', 1), ('y', 2)] | 867 [('x', 1), ('y', 2)] |
| 867 """ | 868 """ |
| 868 | 869 |
| 869 d = copy.copy(d) | 870 d = copy.copy(d) |
| 870 d.update(updates) | 871 d.update(updates) |
| 871 return d | 872 return d |
| OLD | NEW |