OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 import optparse | 6 import optparse |
7 import os | 7 import os |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 command = "%s %s" % (gcl_path, subcommand) | 58 command = "%s %s" % (gcl_path, subcommand) |
59 return os.system(command) | 59 return os.system(command) |
60 | 60 |
61 def gclUpload(revision, author): | 61 def gclUpload(revision, author): |
62 command = ("upload " + str(revision) + | 62 command = ("upload " + str(revision) + |
63 " --send_mail --no_presubmit --reviewers=" + author) | 63 " --send_mail --no_presubmit --reviewers=" + author) |
64 return runGcl(command) | 64 return runGcl(command) |
65 | 65 |
66 def getSVNInfo(url, revision): | 66 def getSVNInfo(url, revision): |
67 svn_info = subprocess2.check_output( | |
68 ['svn', 'info', '%s@%s' % (url, revision)]).splitlines() | |
69 info = {} | 67 info = {} |
70 for line in svn_info: | 68 try: |
71 match = re.search(r"(.*?):(.*)", line) | 69 svn_info = subprocess2.check_output( |
72 if match: | 70 ['svn', 'info', '%s@%s' % (url, revision)]).splitlines() |
73 info[match.group(1).strip()]=match.group(2).strip() | 71 for line in svn_info: |
74 | 72 match = re.search(r"(.*?):(.*)", line) |
| 73 if match: |
| 74 info[match.group(1).strip()] = match.group(2).strip() |
| 75 except subprocess2.CalledProcessError: |
| 76 pass |
75 return info | 77 return info |
76 | 78 |
77 def isSVNDirty(): | 79 def isSVNDirty(): |
78 svn_status = subprocess2.check_output(['svn', 'status']).splitlines() | 80 svn_status = subprocess2.check_output(['svn', 'status']).splitlines() |
79 for line in svn_status: | 81 for line in svn_status: |
80 match = re.search(r"^[^X?]", line) | 82 match = re.search(r"^[^X?]", line) |
81 if match: | 83 if match: |
82 return True | 84 return True |
83 | 85 |
84 return False | 86 return False |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 546 |
545 if options.local and (options.revert or options.branch): | 547 if options.local and (options.revert or options.branch): |
546 option_parser.error("--local cannot be used with --revert or --branch") | 548 option_parser.error("--local cannot be used with --revert or --branch") |
547 return 1 | 549 return 1 |
548 | 550 |
549 return drover(options, args) | 551 return drover(options, args) |
550 | 552 |
551 | 553 |
552 if __name__ == "__main__": | 554 if __name__ == "__main__": |
553 sys.exit(main()) | 555 sys.exit(main()) |
OLD | NEW |