Left: | ||
Right: |
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 if opts.get('no_mail'): | 80 if opts.get('no_mail'): |
81 print 'No reviewers specified, edit the review to add some.' | 81 ui.status('No reviewers specified, edit the review to add ' |
Wladimir Palant
2016/11/23 16:30:14
Please use ui.status() rather than print, this wil
Felix Dahlke
2016/11/23 17:21:26
Done.
| |
82 'some.\n') | |
82 else: | 83 else: |
83 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', | 84 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', |
84 '') | 85 '') |
85 if not opts['reviewers'].strip(): | 86 if not opts['reviewers'].strip(): |
86 raise error.Abort('No reviewers given.') | 87 raise error.Abort('No reviewers given.') |
87 | 88 |
88 for opt in ('reviewers', 'cc'): | 89 for opt in ('reviewers', 'cc'): |
89 if opts.get(opt): | 90 if opts.get(opt): |
90 users = [u if '@' in u else u + '@adblockplus.org' | 91 users = [u if '@' in u else u + '@adblockplus.org' |
91 for u in re.split(r'\s*,\s*', opts[opt])] | 92 for u in re.split(r'\s*,\s*', opts[opt])] |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 </body> | 156 </body> |
156 </html> | 157 </html> |
157 ''' % port | 158 ''' % port |
158 | 159 |
159 # Run the upload tool | 160 # Run the upload tool |
160 issue, patchset = scope['RealMain']([upload_path] + args) | 161 issue, patchset = scope['RealMain']([upload_path] + args) |
161 | 162 |
162 # Wait for the page to check in and retrieve issue URL | 163 # Wait for the page to check in and retrieve issue URL |
163 if server: | 164 if server: |
164 server.handle_request() | 165 server.handle_request() |
LEFT | RIGHT |