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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 # normpath is required to allow DEPS to use .. in their | 282 # normpath is required to allow DEPS to use .. in their |
283 # dependency local path. | 283 # dependency local path. |
284 rel_deps[os.path.normpath(os.path.join(self.name, d))] = url | 284 rel_deps[os.path.normpath(os.path.join(self.name, d))] = url |
285 deps = rel_deps | 285 deps = rel_deps |
286 | 286 |
287 # Convert the deps into real Dependency. | 287 # Convert the deps into real Dependency. |
288 for name, url in deps.iteritems(): | 288 for name, url in deps.iteritems(): |
289 if name in [s.name for s in self.dependencies]: | 289 if name in [s.name for s in self.dependencies]: |
290 raise | 290 raise |
291 self.dependencies.append(Dependency(self, name, url)) | 291 self.dependencies.append(Dependency(self, name, url)) |
292 # Sort by name. | |
293 self.dependencies.sort(key=lambda x: x.name) | |
294 logging.info('Loaded: %s' % str(self)) | 292 logging.info('Loaded: %s' % str(self)) |
295 | 293 |
296 def RunCommandRecursively(self, options, revision_overrides, | 294 def RunCommandRecursively(self, options, revision_overrides, |
297 command, args, pm): | 295 command, args, pm): |
298 """Runs 'command' before parsing the DEPS in case it's a initial checkout | 296 """Runs 'command' before parsing the DEPS in case it's a initial checkout |
299 or a revert.""" | 297 or a revert.""" |
300 assert self.file_list == [] | 298 assert self.file_list == [] |
301 # When running runhooks, there's no need to consult the SCM. | 299 # When running runhooks, there's no need to consult the SCM. |
302 # All known hooks are expected to run unconditionally regardless of working | 300 # All known hooks are expected to run unconditionally regardless of working |
303 # copy state, so skip the SCM status check. | 301 # copy state, so skip the SCM status check. |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 return CMDhelp(parser, argv) | 1132 return CMDhelp(parser, argv) |
1135 except gclient_utils.Error, e: | 1133 except gclient_utils.Error, e: |
1136 print >> sys.stderr, 'Error: %s' % str(e) | 1134 print >> sys.stderr, 'Error: %s' % str(e) |
1137 return 1 | 1135 return 1 |
1138 | 1136 |
1139 | 1137 |
1140 if '__main__' == __name__: | 1138 if '__main__' == __name__: |
1141 sys.exit(Main(sys.argv[1:])) | 1139 sys.exit(Main(sys.argv[1:])) |
1142 | 1140 |
1143 # vim: ts=2:sw=2:tw=80:et: | 1141 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |