Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: scripts/slave/gclient_safe_revert.py

Issue 2444403003: Avoid unnecessary file churn by "git reset --hard" step. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698