OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 if self.parent in self.root_parent().dependencies: | 217 if self.parent in self.root_parent().dependencies: |
218 root_deps = self.root_parent().dependencies | 218 root_deps = self.root_parent().dependencies |
219 for i in range(0, root_deps.index(self.parent)): | 219 for i in range(0, root_deps.index(self.parent)): |
220 value = root_deps[i] | 220 value = root_deps[i] |
221 if value.name: | 221 if value.name: |
222 self.requirements.add(value.name) | 222 self.requirements.add(value.name) |
223 | 223 |
224 if isinstance(self.url, self.FromImpl): | 224 if isinstance(self.url, self.FromImpl): |
225 self.requirements.add(self.url.module_name) | 225 self.requirements.add(self.url.module_name) |
226 | 226 |
227 if self.name: | 227 if self.name and self.should_process: |
228 def yield_full_tree(root): | 228 def yield_full_tree(root): |
229 """Depth-first recursion.""" | 229 """Depth-first recursion.""" |
230 yield root | 230 yield root |
231 for i in root.dependencies: | 231 for i in root.dependencies: |
232 for j in yield_full_tree(i): | 232 for j in yield_full_tree(i): |
233 yield j | 233 if j.should_process: |
| 234 yield j |
234 | 235 |
235 for obj in yield_full_tree(self.root_parent()): | 236 for obj in yield_full_tree(self.root_parent()): |
236 if obj is self or not obj.name: | 237 if obj is self or not obj.name: |
237 continue | 238 continue |
238 # Step 1: Find any requirements self may need. | 239 # Step 1: Find any requirements self may need. |
239 if self.name.startswith(posixpath.join(obj.name, '')): | 240 if self.name.startswith(posixpath.join(obj.name, '')): |
240 self.requirements.add(obj.name) | 241 self.requirements.add(obj.name) |
241 # Step 2: Find any requirements self may impose. | 242 # Step 2: Find any requirements self may impose. |
242 if obj.name.startswith(posixpath.join(self.name, '')): | 243 if obj.name.startswith(posixpath.join(self.name, '')): |
243 obj.requirements.add(self.name) | 244 obj.requirements.add(self.name) |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1358 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1358 print >> sys.stderr, 'Error: %s' % str(e) | 1359 print >> sys.stderr, 'Error: %s' % str(e) |
1359 return 1 | 1360 return 1 |
1360 | 1361 |
1361 | 1362 |
1362 if '__main__' == __name__: | 1363 if '__main__' == __name__: |
1363 fix_encoding.fix_encoding() | 1364 fix_encoding.fix_encoding() |
1364 sys.exit(Main(sys.argv[1:])) | 1365 sys.exit(Main(sys.argv[1:])) |
1365 | 1366 |
1366 # vim: ts=2:sw=2:tw=80:et: | 1367 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |