| 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 """A wrapper script to manage a set of client modules in different SCM. | 6 """A wrapper script to manage a set of client modules in different SCM. |
| 7 | 7 |
| 8 This script is intended to be used to help basic management of client | 8 This script is intended to be used to help basic management of client |
| 9 program sources residing in one or more Subversion modules and Git | 9 program sources residing in one or more Subversion modules and Git |
| 10 repositories, along with other modules it depends on, also in Subversion or Git, | 10 repositories, along with other modules it depends on, also in Subversion or Git, |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 raise gclient_utils.Error("client not configured; see 'gclient config'") | 894 raise gclient_utils.Error("client not configured; see 'gclient config'") |
| 895 if options.verbose: | 895 if options.verbose: |
| 896 # Print out the .gclient file. This is longer than if we just printed the | 896 # Print out the .gclient file. This is longer than if we just printed the |
| 897 # client dict, but more legible, and it might contain helpful comments. | 897 # client dict, but more legible, and it might contain helpful comments. |
| 898 print(client.ConfigContent()) | 898 print(client.ConfigContent()) |
| 899 return client.RunOnDeps('pack', args) | 899 return client.RunOnDeps('pack', args) |
| 900 | 900 |
| 901 | 901 |
| 902 def CMDstatus(parser, args): | 902 def CMDstatus(parser, args): |
| 903 """Show modification status for every dependencies.""" | 903 """Show modification status for every dependencies.""" |
| 904 parser.add_option("--deps", dest="deps_os", metavar="OS_LIST", |
| 905 help="sync deps for the specified (comma-separated) " |
| 906 "platform(s); 'all' will sync all platforms") |
| 904 (options, args) = parser.parse_args(args) | 907 (options, args) = parser.parse_args(args) |
| 905 client = GClient.LoadCurrentConfig(options) | 908 client = GClient.LoadCurrentConfig(options) |
| 906 if not client: | 909 if not client: |
| 907 raise gclient_utils.Error("client not configured; see 'gclient config'") | 910 raise gclient_utils.Error("client not configured; see 'gclient config'") |
| 908 if options.verbose: | 911 if options.verbose: |
| 909 # Print out the .gclient file. This is longer than if we just printed the | 912 # Print out the .gclient file. This is longer than if we just printed the |
| 910 # client dict, but more legible, and it might contain helpful comments. | 913 # client dict, but more legible, and it might contain helpful comments. |
| 911 print(client.ConfigContent()) | 914 print(client.ConfigContent()) |
| 912 return client.RunOnDeps('status', args) | 915 return client.RunOnDeps('status', args) |
| 913 | 916 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 raise gclient_utils.Error("client not configured; see 'gclient config'") | 995 raise gclient_utils.Error("client not configured; see 'gclient config'") |
| 993 if options.verbose: | 996 if options.verbose: |
| 994 # Print out the .gclient file. This is longer than if we just printed the | 997 # Print out the .gclient file. This is longer than if we just printed the |
| 995 # client dict, but more legible, and it might contain helpful comments. | 998 # client dict, but more legible, and it might contain helpful comments. |
| 996 print(client.ConfigContent()) | 999 print(client.ConfigContent()) |
| 997 return client.RunOnDeps('diff', args) | 1000 return client.RunOnDeps('diff', args) |
| 998 | 1001 |
| 999 | 1002 |
| 1000 def CMDrevert(parser, args): | 1003 def CMDrevert(parser, args): |
| 1001 """Revert all modifications in every dependencies.""" | 1004 """Revert all modifications in every dependencies.""" |
| 1005 parser.add_option("--deps", dest="deps_os", metavar="OS_LIST", |
| 1006 help="sync deps for the specified (comma-separated) " |
| 1007 "platform(s); 'all' will sync all platforms") |
| 1002 parser.add_option("--nohooks", action="store_true", | 1008 parser.add_option("--nohooks", action="store_true", |
| 1003 help="don't run hooks after the revert is complete") | 1009 help="don't run hooks after the revert is complete") |
| 1004 (options, args) = parser.parse_args(args) | 1010 (options, args) = parser.parse_args(args) |
| 1005 # --force is implied. | 1011 # --force is implied. |
| 1006 options.force = True | 1012 options.force = True |
| 1007 options.deps_os = None | |
| 1008 client = GClient.LoadCurrentConfig(options) | 1013 client = GClient.LoadCurrentConfig(options) |
| 1009 if not client: | 1014 if not client: |
| 1010 raise gclient_utils.Error("client not configured; see 'gclient config'") | 1015 raise gclient_utils.Error("client not configured; see 'gclient config'") |
| 1011 return client.RunOnDeps('revert', args) | 1016 return client.RunOnDeps('revert', args) |
| 1012 | 1017 |
| 1013 | 1018 |
| 1014 def CMDrunhooks(parser, args): | 1019 def CMDrunhooks(parser, args): |
| 1015 """Runs hooks for files that have been modified in the local working copy.""" | 1020 """Runs hooks for files that have been modified in the local working copy.""" |
| 1021 parser.add_option("--deps", dest="deps_os", metavar="OS_LIST", |
| 1022 help="sync deps for the specified (comma-separated) " |
| 1023 "platform(s); 'all' will sync all platforms") |
| 1016 parser.add_option("--force", action="store_true", default=True, | 1024 parser.add_option("--force", action="store_true", default=True, |
| 1017 help="Deprecated. No effect.") | 1025 help="Deprecated. No effect.") |
| 1018 (options, args) = parser.parse_args(args) | 1026 (options, args) = parser.parse_args(args) |
| 1019 client = GClient.LoadCurrentConfig(options) | 1027 client = GClient.LoadCurrentConfig(options) |
| 1020 if not client: | 1028 if not client: |
| 1021 raise gclient_utils.Error("client not configured; see 'gclient config'") | 1029 raise gclient_utils.Error("client not configured; see 'gclient config'") |
| 1022 if options.verbose: | 1030 if options.verbose: |
| 1023 # Print out the .gclient file. This is longer than if we just printed the | 1031 # Print out the .gclient file. This is longer than if we just printed the |
| 1024 # client dict, but more legible, and it might contain helpful comments. | 1032 # client dict, but more legible, and it might contain helpful comments. |
| 1025 print(client.ConfigContent()) | 1033 print(client.ConfigContent()) |
| 1026 options.force = True | 1034 options.force = True |
| 1027 options.nohooks = False | 1035 options.nohooks = False |
| 1028 options.deps_os = None | |
| 1029 return client.RunOnDeps('runhooks', args) | 1036 return client.RunOnDeps('runhooks', args) |
| 1030 | 1037 |
| 1031 | 1038 |
| 1032 def CMDrevinfo(parser, args): | 1039 def CMDrevinfo(parser, args): |
| 1033 """Outputs details for every dependencies.""" | 1040 """Outputs details for every dependencies.""" |
| 1034 parser.add_option("--snapshot", action="store_true", | 1041 parser.add_option("--snapshot", action="store_true", |
| 1035 help="create a snapshot file of the current " | 1042 help="create a snapshot file of the current " |
| 1036 "version of all repositories") | 1043 "version of all repositories") |
| 1037 (options, args) = parser.parse_args(args) | 1044 (options, args) = parser.parse_args(args) |
| 1038 client = GClient.LoadCurrentConfig(options) | 1045 client = GClient.LoadCurrentConfig(options) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 | 1116 |
| 1110 | 1117 |
| 1111 if "__main__" == __name__: | 1118 if "__main__" == __name__: |
| 1112 try: | 1119 try: |
| 1113 sys.exit(Main(sys.argv[1:])) | 1120 sys.exit(Main(sys.argv[1:])) |
| 1114 except gclient_utils.Error, e: | 1121 except gclient_utils.Error, e: |
| 1115 print >> sys.stderr, "Error: %s" % str(e) | 1122 print >> sys.stderr, "Error: %s" % str(e) |
| 1116 sys.exit(1) | 1123 sys.exit(1) |
| 1117 | 1124 |
| 1118 # vim: ts=2:sw=2:tw=80:et: | 1125 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |