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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 439 |
440 for d in self.dependencies: | 440 for d in self.dependencies: |
441 out.extend([' ' + x for x in str(d).splitlines()]) | 441 out.extend([' ' + x for x in str(d).splitlines()]) |
442 out.append('') | 442 out.append('') |
443 return '\n'.join(out) | 443 return '\n'.join(out) |
444 | 444 |
445 def __repr__(self): | 445 def __repr__(self): |
446 return '%s: %s' % (self.name, self.url) | 446 return '%s: %s' % (self.name, self.url) |
447 | 447 |
448 def hierarchy(self): | 448 def hierarchy(self): |
449 "Returns a human-readable hierarchical reference to a Dependency." | 449 """Returns a human-readable hierarchical reference to a Dependency.""" |
450 out = '%s(%s)' % (self.name, self.url) | 450 out = '%s(%s)' % (self.name, self.url) |
451 i = self.parent | 451 i = self.parent |
452 while i and i.name: | 452 while i and i.name: |
453 out = '%s(%s) -> %s' % (i.name, i.url, out) | 453 out = '%s(%s) -> %s' % (i.name, i.url, out) |
454 i = i.parent | 454 i = i.parent |
455 return out | 455 return out |
456 | 456 |
457 | 457 |
458 class GClient(Dependency): | 458 class GClient(Dependency): |
459 """Object that represent a gclient checkout. A tree of Dependency(), one per | 459 """Object that represent a gclient checkout. A tree of Dependency(), one per |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 return CMDhelp(parser, argv) | 1150 return CMDhelp(parser, argv) |
1151 except gclient_utils.Error, e: | 1151 except gclient_utils.Error, e: |
1152 print >> sys.stderr, 'Error: %s' % str(e) | 1152 print >> sys.stderr, 'Error: %s' % str(e) |
1153 return 1 | 1153 return 1 |
1154 | 1154 |
1155 | 1155 |
1156 if '__main__' == __name__: | 1156 if '__main__' == __name__: |
1157 sys.exit(Main(sys.argv[1:])) | 1157 sys.exit(Main(sys.argv[1:])) |
1158 | 1158 |
1159 # vim: ts=2:sw=2:tw=80:et: | 1159 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |