| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
| 7 | 7 |
| 8 Files | 8 Files |
| 9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
| 10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 # dependency, i.e. its DEPS wasn't read. | 158 # dependency, i.e. its DEPS wasn't read. |
| 159 self.deps_parsed = False | 159 self.deps_parsed = False |
| 160 # A direct reference is dependency that is referenced by a deps, deps_os or | 160 # A direct reference is dependency that is referenced by a deps, deps_os or |
| 161 # solution. A indirect one is one that was loaded with From() or that | 161 # solution. A indirect one is one that was loaded with From() or that |
| 162 # exceeded recursion limit. | 162 # exceeded recursion limit. |
| 163 self.direct_reference = False | 163 self.direct_reference = False |
| 164 | 164 |
| 165 # Sanity checks | 165 # Sanity checks |
| 166 if not self.name and self.parent: | 166 if not self.name and self.parent: |
| 167 raise gclient_utils.Error('Dependency without name') | 167 raise gclient_utils.Error('Dependency without name') |
| 168 tree = dict((d.name, d) for d in self.tree(False)) | 168 # TODO(maruel): http://crbug.com/50015 Reenable this check once |
| 169 if self.name in tree: | 169 # self.tree(False) is corrected. |
| 170 raise gclient_utils.Error( | 170 # tree = dict((d.name, d) for d in self.tree(False)) |
| 171 'Dependency %s specified more than once:\n %s\nvs\n %s' % | 171 #if self.name in tree: |
| 172 (self.name, tree[self.name].hierarchy(), self.hierarchy())) | 172 # raise gclient_utils.Error( |
| 173 # 'Dependency %s specified more than once:\n %s\nvs\n %s' % |
| 174 # (self.name, tree[self.name].hierarchy(), self.hierarchy())) |
| 173 if not isinstance(self.url, | 175 if not isinstance(self.url, |
| 174 (basestring, self.FromImpl, self.FileImpl, None.__class__)): | 176 (basestring, self.FromImpl, self.FileImpl, None.__class__)): |
| 175 raise gclient_utils.Error('dependency url must be either a string, None, ' | 177 raise gclient_utils.Error('dependency url must be either a string, None, ' |
| 176 'File() or From() instead of %s' % | 178 'File() or From() instead of %s' % |
| 177 self.url.__class__.__name__) | 179 self.url.__class__.__name__) |
| 178 if '/' in self.deps_file or '\\' in self.deps_file: | 180 if '/' in self.deps_file or '\\' in self.deps_file: |
| 179 raise gclient_utils.Error('deps_file name must not be a path, just a ' | 181 raise gclient_utils.Error('deps_file name must not be a path, just a ' |
| 180 'filename. %s' % self.deps_file) | 182 'filename. %s' % self.deps_file) |
| 181 | 183 |
| 182 def LateOverride(self, url): | 184 def LateOverride(self, url): |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 return CMDhelp(parser, argv) | 1160 return CMDhelp(parser, argv) |
| 1159 except gclient_utils.Error, e: | 1161 except gclient_utils.Error, e: |
| 1160 print >> sys.stderr, 'Error: %s' % str(e) | 1162 print >> sys.stderr, 'Error: %s' % str(e) |
| 1161 return 1 | 1163 return 1 |
| 1162 | 1164 |
| 1163 | 1165 |
| 1164 if '__main__' == __name__: | 1166 if '__main__' == __name__: |
| 1165 sys.exit(Main(sys.argv[1:])) | 1167 sys.exit(Main(sys.argv[1:])) |
| 1166 | 1168 |
| 1167 # vim: ts=2:sw=2:tw=80:et: | 1169 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |