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

Side by Side Diff: tools/revert.py

Issue 11299110: Allow force revert for git users as well. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
« 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/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 import optparse 7 import optparse
8 import os 8 import os
9 import platform 9 import platform
10 import subprocess 10 import subprocess
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 command_sequence += 'git revert -n %s\n' % git_commit_id 170 command_sequence += 'git revert -n %s\n' % git_commit_id
171 maybe_fail('There are conflicts while reverting. Please resolve these ' 171 maybe_fail('There are conflicts while reverting. Please resolve these '
172 'after manually running:\n' + command_sequence + 'and then ' 172 'after manually running:\n' + command_sequence + 'and then '
173 'create a CL and submit to complete the revert.') 173 'create a CL and submit to complete the revert.')
174 run_cmd(['git', 'commit', '-m', commit_msg]) 174 run_cmd(['git', 'commit', '-m', commit_msg])
175 175
176 def main(): 176 def main():
177 revisions = parse_args() 177 revisions = parse_args()
178 git_user = runs_git() 178 git_user = runs_git()
179 if has_new_code(git_user): 179 if has_new_code(git_user):
180 if git_user: 180 maybe_fail('WARNING: This checkout has local modifications!! This could '
181 maybe_fail('Your tree has local modifications! Move to a clean tree and ' 181 'result in a CL that is not just a revert and/or you could lose your'
182 'try running this script again.') 182 ' local changes! Are you **SURE** you want to continue? ',
183 else: 183 user_input=True)
184 maybe_fail('WARNING: This checkout has local modifications!! This could '
185 'result in a CL that is not just a revert and/or you could lose your'
186 ' local changes! Are you **SURE** you want to continue? ',
187 user_input=True)
188 if git_user: 184 if git_user:
189 run_cmd(['git', 'cl', 'rebase']) 185 run_cmd(['git', 'cl', 'rebase'])
190 run_cmd(['gclient', 'sync']) 186 run_cmd(['gclient', 'sync'])
191 revert(revisions[0], revisions[1], git_user) 187 revert(revisions[0], revisions[1], git_user)
192 print ('Now, create a CL and submit! The buildbots and your teammates thank ' 188 print ('Now, create a CL and submit! The buildbots and your teammates thank '
193 'you!') 189 'you!')
194 190
195 if __name__ == '__main__': 191 if __name__ == '__main__':
196 main() 192 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