Chromium Code Reviews| Index: gclient.py |
| diff --git a/gclient.py b/gclient.py |
| index c23b0023cfc56b21c65f152a529671c65c2e4ccb..0fcd099157dcc93c76f564648773444ddde7b959 100644 |
| --- a/gclient.py |
| +++ b/gclient.py |
| @@ -325,10 +325,21 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): |
| # This require a full tree traversal with locks. |
| siblings = [d for d in self.root.subtree(False) if d.name == self.name] |
| for sibling in siblings: |
| - if self.url != sibling.url: |
| - raise gclient_utils.Error( |
| - 'Dependency %s specified more than once:\n %s\nvs\n %s' % |
| - (self.name, sibling.hierarchy(), self.hierarchy())) |
| + self_url = self.LateOverride(self.url) |
| + sibling_url = sibling.LateOverride(sibling.url) |
| + if self_url != sibling_url: |
|
szager1
2012/10/09 18:30:11
if self_url and sibling_url and self_url != siblin
M-A Ruel
2012/10/09 18:38:22
Agreed, I changed it.
|
| + # Allow to have only one to be None. |
| + if bool(self_url is None) == bool(sibling_url is None): |
| + raise gclient_utils.Error( |
| + ('Dependency %s specified more than once:\n' |
| + ' %s [%s]\n' |
| + 'vs\n' |
| + ' %s [%s]') % ( |
| + self.name, |
| + sibling.hierarchy(), |
| + sibling_url, |
| + self.hierarchy(), |
| + self_url)) |
| # In theory we could keep it as a shadow of the other one. In |
| # practice, simply ignore it. |
| logging.warn('Won\'t process duplicate dependency %s' % sibling) |