OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # Files | 7 # Files |
8 # .gclient : Current client configuration, written by 'config' command. | 8 # .gclient : Current client configuration, written by 'config' command. |
9 # Format is a Python script defining 'solutions', a list whose | 9 # Format is a Python script defining 'solutions', a list whose |
10 # entries each are maps binding the strings "name" and "url" | 10 # entries each are maps binding the strings "name" and "url" |
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 # client dict, but more legible, and it might contain helpful comments. | 1739 # client dict, but more legible, and it might contain helpful comments. |
1740 print(client.config_content) | 1740 print(client.config_content) |
1741 ret = client.RunOnDeps('update', args) | 1741 ret = client.RunOnDeps('update', args) |
1742 if options.output_json: | 1742 if options.output_json: |
1743 slns = {} | 1743 slns = {} |
1744 for d in client.subtree(True): | 1744 for d in client.subtree(True): |
1745 normed = d.name.replace('\\', '/').rstrip('/') + '/' | 1745 normed = d.name.replace('\\', '/').rstrip('/') + '/' |
1746 slns[normed] = { | 1746 slns[normed] = { |
1747 'revision': d.got_revision, | 1747 'revision': d.got_revision, |
1748 'scm': d.used_scm.name if d.used_scm else None, | 1748 'scm': d.used_scm.name if d.used_scm else None, |
| 1749 'url': d.url if d.url else None, |
1749 } | 1750 } |
1750 with open(options.output_json, 'wb') as f: | 1751 with open(options.output_json, 'wb') as f: |
1751 json.dump({'solutions': slns}, f) | 1752 json.dump({'solutions': slns}, f) |
1752 return ret | 1753 return ret |
1753 | 1754 |
1754 | 1755 |
1755 CMDupdate = CMDsync | 1756 CMDupdate = CMDsync |
1756 | 1757 |
1757 | 1758 |
1758 def CMDdiff(parser, args): | 1759 def CMDdiff(parser, args): |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 print >> sys.stderr, 'Error: %s' % str(e) | 1968 print >> sys.stderr, 'Error: %s' % str(e) |
1968 return 1 | 1969 return 1 |
1969 finally: | 1970 finally: |
1970 gclient_utils.PrintWarnings() | 1971 gclient_utils.PrintWarnings() |
1971 | 1972 |
1972 | 1973 |
1973 if '__main__' == __name__: | 1974 if '__main__' == __name__: |
1974 sys.exit(Main(sys.argv[1:])) | 1975 sys.exit(Main(sys.argv[1:])) |
1975 | 1976 |
1976 # vim: ts=2:sw=2:tw=80:et: | 1977 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |