| LEFT | RIGHT |
| 1 import BaseHTTPServer | 1 import BaseHTTPServer |
| 2 import os | 2 import os |
| 3 import re | 3 import re |
| 4 import socket | 4 import socket |
| 5 import sys | 5 import sys |
| 6 import urllib | 6 import urllib |
| 7 | 7 |
| 8 from mercurial import cmdutil, error | 8 from mercurial import cmdutil, error |
| 9 | 9 |
| 10 SERVER = 'https://codereview.adblockplus.org' | 10 SERVER = 'https://codereview.adblockplus.org' |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 path = (ui.config('paths', 'default-push') | 71 path = (ui.config('paths', 'default-push') |
| 72 or ui.config('paths', 'default') | 72 or ui.config('paths', 'default') |
| 73 or '') | 73 or '') |
| 74 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) | 74 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) |
| 75 if match: | 75 if match: |
| 76 opts['base_url'] = 'https://' + match.group(1) | 76 opts['base_url'] = 'https://' + match.group(1) |
| 77 | 77 |
| 78 # Make sure there is at least one reviewer | 78 # Make sure there is at least one reviewer |
| 79 if not opts.get('reviewers'): | 79 if not opts.get('reviewers'): |
| 80 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', '') | 80 if opts.get('no_mail'): |
| 81 if not opts.get('no_mail') and not opts['reviewers'].strip(): | 81 ui.status('No reviewers specified, edit the review to add ' |
| 82 raise error.Abort('No reviewers given.') | 82 'some.\n') |
| 83 else: |
| 84 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', |
| 85 '') |
| 86 if not opts['reviewers'].strip(): |
| 87 raise error.Abort('No reviewers given.') |
| 83 | 88 |
| 84 for opt in ('reviewers', 'cc'): | 89 for opt in ('reviewers', 'cc'): |
| 85 if opts.get(opt): | 90 if opts.get(opt): |
| 86 users = [u if '@' in u else u + '@adblockplus.org' | 91 users = [u if '@' in u else u + '@adblockplus.org' |
| 87 for u in re.split(r'\s*,\s*', opts[opt])] | 92 for u in re.split(r'\s*,\s*', opts[opt])] |
| 88 opts[opt] = ','.join(users) | 93 opts[opt] = ','.join(users) |
| 89 | 94 |
| 90 for opt in ('issue', 'title', 'message', 'reviewers', 'cc', 'base_url'): | 95 for opt in ('issue', 'title', 'message', 'reviewers', 'cc', 'base_url'): |
| 91 if opts.get(opt, ''): | 96 if opts.get(opt, ''): |
| 92 args.extend(['--' + opt, opts[opt]]) | 97 args.extend(['--' + opt, opts[opt]]) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 </body> | 156 </body> |
| 152 </html> | 157 </html> |
| 153 ''' % port | 158 ''' % port |
| 154 | 159 |
| 155 # Run the upload tool | 160 # Run the upload tool |
| 156 issue, patchset = scope['RealMain']([upload_path] + args) | 161 issue, patchset = scope['RealMain']([upload_path] + args) |
| 157 | 162 |
| 158 # Wait for the page to check in and retrieve issue URL | 163 # Wait for the page to check in and retrieve issue URL |
| 159 if server: | 164 if server: |
| 160 server.handle_request() | 165 server.handle_request() |
| LEFT | RIGHT |