| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 for i in range(len(self.file_list)): | 355 for i in range(len(self.file_list)): |
| 356 # It depends on the command being executed (like runhooks vs sync). | 356 # It depends on the command being executed (like runhooks vs sync). |
| 357 if not os.path.isabs(self.file_list[i]): | 357 if not os.path.isabs(self.file_list[i]): |
| 358 continue | 358 continue |
| 359 | 359 |
| 360 prefix = os.path.commonprefix([self.root_dir().lower(), | 360 prefix = os.path.commonprefix([self.root_dir().lower(), |
| 361 self.file_list[i].lower()]) | 361 self.file_list[i].lower()]) |
| 362 self.file_list[i] = self.file_list[i][len(prefix):] | 362 self.file_list[i] = self.file_list[i][len(prefix):] |
| 363 | 363 |
| 364 # Strip any leading path separators. | 364 # Strip any leading path separators. |
| 365 while file_list[i].startswith('\\') or file_list[i].startswith('/'): | 365 while (self.file_list[i].startswith('\\') or |
| 366 self.file_list[i].startswith('/')): |
| 366 self.file_list[i] = self.file_list[i][1:] | 367 self.file_list[i] = self.file_list[i][1:] |
| 367 | 368 |
| 368 # Run hooks on the basis of whether the files from the gclient operation | 369 # Run hooks on the basis of whether the files from the gclient operation |
| 369 # match each hook's pattern. | 370 # match each hook's pattern. |
| 370 for hook_dict in self.deps_hooks: | 371 for hook_dict in self.deps_hooks: |
| 371 pattern = re.compile(hook_dict['pattern']) | 372 pattern = re.compile(hook_dict['pattern']) |
| 372 matching_file_list = [f for f in self.file_list if pattern.search(f)] | 373 matching_file_list = [f for f in self.file_list if pattern.search(f)] |
| 373 if matching_file_list: | 374 if matching_file_list: |
| 374 self._RunHookAction(hook_dict, matching_file_list) | 375 self._RunHookAction(hook_dict, matching_file_list) |
| 375 if self.recursion_limit(): | 376 if self.recursion_limit(): |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 return CMDhelp(parser, argv) | 1116 return CMDhelp(parser, argv) |
| 1116 except gclient_utils.Error, e: | 1117 except gclient_utils.Error, e: |
| 1117 print >> sys.stderr, 'Error: %s' % str(e) | 1118 print >> sys.stderr, 'Error: %s' % str(e) |
| 1118 return 1 | 1119 return 1 |
| 1119 | 1120 |
| 1120 | 1121 |
| 1121 if '__main__' == __name__: | 1122 if '__main__' == __name__: |
| 1122 sys.exit(Main(sys.argv[1:])) | 1123 sys.exit(Main(sys.argv[1:])) |
| 1123 | 1124 |
| 1124 # vim: ts=2:sw=2:tw=80:et: | 1125 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |