| OLD | NEW |
| 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import optparse | 5 import optparse |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import webbrowser | 10 import webbrowser |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 Example: %(app)s --revert 12345 | 32 Example: %(app)s --revert 12345 |
| 33 | 33 |
| 34 [Revert from branch] | 34 [Revert from branch] |
| 35 --revert <revision> --branch <branch_num> | 35 --revert <revision> --branch <branch_num> |
| 36 Example: %(app)s --revert 12345 --branch 187 | 36 Example: %(app)s --revert 12345 --branch 187 |
| 37 """ | 37 """ |
| 38 | 38 |
| 39 export_map_ = None | 39 export_map_ = None |
| 40 files_info_ = None | 40 files_info_ = None |
| 41 delete_map_ = None | 41 delete_map_ = None |
| 42 file_pattern_ = r"[ ]+([MADUC])[ ]+/((?:trunk|branches/\d+)/src(.*)/(.*))" | 42 file_pattern_ = r"[ ]+([MADUC])[ ]+/((?:trunk|branches/.*?)/src(.*)/(.*))" |
| 43 | 43 |
| 44 def deltree(root): | 44 def deltree(root): |
| 45 """Removes a given directory""" | 45 """Removes a given directory""" |
| 46 if (not os.path.exists(root)): | 46 if (not os.path.exists(root)): |
| 47 return | 47 return |
| 48 | 48 |
| 49 if sys.platform == 'win32': | 49 if sys.platform == 'win32': |
| 50 os.system('rmdir /S /Q ' + root.replace('/','\\')) | 50 os.system('rmdir /S /Q ' + root.replace('/','\\')) |
| 51 else: | 51 else: |
| 52 for name in os.listdir(root): | 52 for name in os.listdir(root): |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 548 |
| 549 if not options.merge and not options.revert: | 549 if not options.merge and not options.revert: |
| 550 option_parser.error("You need at least --merge or --revert") | 550 option_parser.error("You need at least --merge or --revert") |
| 551 sys.exit(1) | 551 sys.exit(1) |
| 552 | 552 |
| 553 if options.merge and not options.branch: | 553 if options.merge and not options.branch: |
| 554 option_parser.error("--merge requires a --branch") | 554 option_parser.error("--merge requires a --branch") |
| 555 sys.exit(1) | 555 sys.exit(1) |
| 556 | 556 |
| 557 sys.exit(main(options, args)) | 557 sys.exit(main(options, args)) |
| OLD | NEW |