Chromium Code Reviews| 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 | 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 695 def GetHookAction(hook_dict, matching_file_list): | 695 def GetHookAction(hook_dict, matching_file_list): |
| 696 """Turns a parsed 'hook' dict into an executable command.""" | 696 """Turns a parsed 'hook' dict into an executable command.""" |
| 697 logging.debug(hook_dict) | 697 logging.debug(hook_dict) |
| 698 logging.debug(matching_file_list) | 698 logging.debug(matching_file_list) |
| 699 command = hook_dict['action'][:] | 699 command = hook_dict['action'][:] |
| 700 if command[0] == 'python': | 700 if command[0] == 'python': |
| 701 # If the hook specified "python" as the first item, the action is a | 701 # If the hook specified "python" as the first item, the action is a |
| 702 # Python script. Run it by starting a new copy of the same | 702 # Python script. Run it by starting a new copy of the same |
| 703 # interpreter. | 703 # interpreter. |
| 704 command[0] = sys.executable | 704 command[0] = sys.executable |
| 705 if not command[0]: | |
|
M-A Ruel
2013/01/25 01:01:30
Please put it directly first thing into main() ins
bcwhite
2013/01/30 16:58:53
Done.
| |
| 706 raise gclient_utils.Error( | |
| 707 'Python does not know the location of it\'s own executable.') | |
| 705 if '$matching_files' in command: | 708 if '$matching_files' in command: |
| 706 splice_index = command.index('$matching_files') | 709 splice_index = command.index('$matching_files') |
| 707 command[splice_index:splice_index + 1] = matching_file_list | 710 command[splice_index:splice_index + 1] = matching_file_list |
| 708 return command | 711 return command |
| 709 | 712 |
| 710 def GetHooks(self, options): | 713 def GetHooks(self, options): |
| 711 """Evaluates all hooks, and return them in a flat list. | 714 """Evaluates all hooks, and return them in a flat list. |
| 712 | 715 |
| 713 RunOnDeps() must have been called before to load the DEPS. | 716 RunOnDeps() must have been called before to load the DEPS. |
| 714 """ | 717 """ |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1750 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1753 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1751 print >> sys.stderr, 'Error: %s' % str(e) | 1754 print >> sys.stderr, 'Error: %s' % str(e) |
| 1752 return 1 | 1755 return 1 |
| 1753 | 1756 |
| 1754 | 1757 |
| 1755 if '__main__' == __name__: | 1758 if '__main__' == __name__: |
| 1756 fix_encoding.fix_encoding() | 1759 fix_encoding.fix_encoding() |
| 1757 sys.exit(Main(sys.argv[1:])) | 1760 sys.exit(Main(sys.argv[1:])) |
| 1758 | 1761 |
| 1759 # vim: ts=2:sw=2:tw=80:et: | 1762 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |