| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Do a revert if a checkout exists.""" | 6 """Do a revert if a checkout exists.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 if not os.path.exists(gclient_config): | 36 if not os.path.exists(gclient_config): |
| 37 print ('%s doesn\'t exist, not a gclient-controlled checkout.' % | 37 print ('%s doesn\'t exist, not a gclient-controlled checkout.' % |
| 38 gclient_config) | 38 gclient_config) |
| 39 return 0 | 39 return 0 |
| 40 | 40 |
| 41 # Work around http://crbug.com/280158 | 41 # Work around http://crbug.com/280158 |
| 42 cmd = [gclient_command, 'recurse', '-i', 'sh', '-c', | 42 cmd = [gclient_command, 'recurse', '-i', 'sh', '-c', |
| 43 'if [ -e .git ]; then git remote update; fi'] | 43 'if [ -e .git ]; then git remote update; fi'] |
| 44 chromium_utils.RunCommand(cmd, cwd=build_directory) | 44 chromium_utils.RunCommand(cmd, cwd=build_directory) |
| 45 | 45 |
| 46 # Work around http://crbug.com/642711 |
| 47 cmd = [gclient_command, 'recurse', '-v', 'git', 'update-index', '--refresh'] |
| 48 chromium_utils.RunCommand(cmd, cwd=build_directory) |
| 49 |
| 46 cmd = [gclient_command, 'revert', '-v', '-v', '-v', '--nohooks', '--upstream'] | 50 cmd = [gclient_command, 'revert', '-v', '-v', '-v', '--nohooks', '--upstream'] |
| 47 return chromium_utils.RunCommand(cmd, cwd=build_directory) | 51 return chromium_utils.RunCommand(cmd, cwd=build_directory) |
| 48 | 52 |
| 49 | 53 |
| 50 if '__main__' == __name__: | 54 if '__main__' == __name__: |
| 51 sys.exit(main()) | 55 sys.exit(main()) |
| OLD | NEW |