| 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 import re | 5 import re |
| 6 | 6 |
| 7 from common import dependency | 7 from common import dependency |
| 8 from common import deps_parser | 8 from common import deps_parser |
| 9 | 9 |
| 10 _CHROMIUM_ROOT_DIR = 'src/' | 10 _CHROMIUM_ROOT_DIR = 'src/' |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 for child in dep.children.values(): | 93 for child in dep.children.values(): |
| 94 FlattenDepTree(child) | 94 FlattenDepTree(child) |
| 95 | 95 |
| 96 FlattenDepTree(root_dep) | 96 FlattenDepTree(root_dep) |
| 97 | 97 |
| 98 # Make sure that DEPS file in buildspec/ overwrite the chromium repo. | 98 # Make sure that DEPS file in buildspec/ overwrite the chromium repo. |
| 99 dependencies[_CHROMIUM_ROOT_DIR] = root_dep | 99 dependencies[_CHROMIUM_ROOT_DIR] = root_dep |
| 100 | 100 |
| 101 return dependencies | 101 return dependencies |
| 102 | 102 |
| 103 | |
| 104 def GetDependencyRolls(self, old_cr_revision, new_cr_revision, platform, | 103 def GetDependencyRolls(self, old_cr_revision, new_cr_revision, platform, |
| 105 skip_chromium_roll=True): | 104 skip_chromium_roll=True): |
| 106 """Returns a list of dependency rolls between the given Chromium revisions. | 105 """Returns a list of dependency rolls between the given Chromium revisions. |
| 107 | 106 |
| 108 Args: | 107 Args: |
| 109 old_cr_revision (str): The old Chromium revision, it can be a githash or a | 108 old_cr_revision (str): The old Chromium revision, it can be a githash or a |
| 110 chrome version for a official build. | 109 chrome version for a official build. |
| 111 new_cr_revision (str): The new Chromium revision, it can be a githash or a | 110 new_cr_revision (str): The new Chromium revision, it can be a githash or a |
| 112 chrome version for a official build. | 111 chrome version for a official build. |
| 113 platform (str): The target OS platform of the Chrome or test binary. | 112 platform (str): The target OS platform of the Chrome or test binary. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 136 path, new_dep.repo_url, old_revision, new_dep.revision)) | 135 path, new_dep.repo_url, old_revision, new_dep.revision)) |
| 137 | 136 |
| 138 for path, old_dep in old_deps.iteritems(): | 137 for path, old_dep in old_deps.iteritems(): |
| 139 if path not in new_deps: | 138 if path not in new_deps: |
| 140 rolls.append( | 139 rolls.append( |
| 141 dependency.DependencyRoll( | 140 dependency.DependencyRoll( |
| 142 path, old_dep.repo_url, old_dep.revision, None)) | 141 path, old_dep.repo_url, old_dep.revision, None)) |
| 143 | 142 |
| 144 return rolls | 143 return rolls |
| 145 | 144 |
| 146 | |
| 147 def GetDependencyRollsDict(self, old_cr_revision, new_cr_revision, platform): | 145 def GetDependencyRollsDict(self, old_cr_revision, new_cr_revision, platform): |
| 148 """Gets dep_path to DependencyRoll dictionary for deps between revisions. | 146 """Gets dep_path to DependencyRoll dictionary for deps between revisions. |
| 149 | 147 |
| 150 Args: | 148 Args: |
| 151 old_cr_revision (str): The old Chromium revision, it can be a githash or a | 149 old_cr_revision (str): The old Chromium revision, it can be a githash or a |
| 152 chrome version for a official build. | 150 chrome version for a official build. |
| 153 new_cr_revision (str): The new Chromium revision, it can be a githash or a | 151 new_cr_revision (str): The new Chromium revision, it can be a githash or a |
| 154 chrome version for a official build. | 152 chrome version for a official build. |
| 155 platform (str): The target OS platform of the Chrome or test binary. | 153 platform (str): The target OS platform of the Chrome or test binary. |
| 156 | 154 |
| 157 Returns: | 155 Returns: |
| 158 A dict, mapping dep path to its DependencyRoll. | 156 A dict, mapping dep path to its DependencyRoll. |
| 159 """ | 157 """ |
| 160 deps_rolls = self.GetDependencyRolls(old_cr_revision, new_cr_revision, | 158 deps_rolls = self.GetDependencyRolls(old_cr_revision, new_cr_revision, |
| 161 platform, skip_chromium_roll=False) | 159 platform, skip_chromium_roll=False) |
| 162 | 160 |
| 163 deps_rolls_dict = {} | 161 deps_rolls_dict = {} |
| 164 | 162 |
| 165 for dep_roll in deps_rolls: | 163 for dep_roll in deps_rolls: |
| 166 deps_rolls_dict[dep_roll.path] = dep_roll | 164 deps_rolls_dict[dep_roll.path] = dep_roll |
| 167 | 165 |
| 168 return deps_rolls_dict | 166 return deps_rolls_dict |
| OLD | NEW |