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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 return self.parent.recursion_limit() - 1 | 420 return self.parent.recursion_limit() - 1 |
421 | 421 |
422 def tree(self, force_all): | 422 def tree(self, force_all): |
423 return self.parent.tree(force_all) | 423 return self.parent.tree(force_all) |
424 | 424 |
425 def subtree(self, force_all): | 425 def subtree(self, force_all): |
426 result = [] | 426 result = [] |
427 # Add breadth-first. | 427 # Add breadth-first. |
428 if self.direct_reference or force_all: | 428 if self.direct_reference or force_all: |
429 for d in self.dependencies: | 429 for d in self.dependencies: |
430 result.append(d) | 430 result.append(d) |
431 for d in self.dependencies: | 431 for d in self.dependencies: |
432 result.extend(d.subtree(force_all)) | 432 result.extend(d.subtree(force_all)) |
433 return result | 433 return result |
434 | 434 |
435 def get_custom_deps(self, name, url): | 435 def get_custom_deps(self, name, url): |
436 """Returns a custom deps if applicable.""" | 436 """Returns a custom deps if applicable.""" |
437 if self.parent: | 437 if self.parent: |
438 url = self.parent.get_custom_deps(name, url) | 438 url = self.parent.get_custom_deps(name, url) |
439 # None is a valid return value to disable a dependency. | 439 # None is a valid return value to disable a dependency. |
440 return self.custom_deps.get(name, url) | 440 return self.custom_deps.get(name, url) |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 return CMDhelp(parser, argv) | 1151 return CMDhelp(parser, argv) |
1152 except gclient_utils.Error, e: | 1152 except gclient_utils.Error, e: |
1153 print >> sys.stderr, 'Error: %s' % str(e) | 1153 print >> sys.stderr, 'Error: %s' % str(e) |
1154 return 1 | 1154 return 1 |
1155 | 1155 |
1156 | 1156 |
1157 if '__main__' == __name__: | 1157 if '__main__' == __name__: |
1158 sys.exit(Main(sys.argv[1:])) | 1158 sys.exit(Main(sys.argv[1:])) |
1159 | 1159 |
1160 # vim: ts=2:sw=2:tw=80:et: | 1160 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |