| OLD | NEW |
| 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 Loading... |
| 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() |
| OLD | NEW |