| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 args.extend(['--rev', opts['revision']]) | 55 args.extend(['--rev', opts['revision']]) |
| 56 else: | 56 else: |
| 57 raise error.Abort('What should be reviewed? Either --revision or --chang e is required.') | 57 raise error.Abort('What should be reviewed? Either --revision or --chang e is required.') |
| 58 | 58 |
| 59 if not opts.get('issue'): | 59 if not opts.get('issue'): |
| 60 # New issue, make sure title and message are set | 60 # New issue, make sure title and message are set |
| 61 fulltitle = None | 61 fulltitle = None |
| 62 | 62 |
| 63 if not opts.get('title') and not opts.get('change'): | 63 if not opts.get('title') and not opts.get('change'): |
| 64 opts['title'] = ui.prompt('New review title: ', '') | 64 opts['title'] = ui.prompt('New review title: ', '') |
| 65 elif not opts.get('title') and opts.get('change'): | 65 elif not opts.get('title'): |
|
Wladimir Palant
2017/07/18 12:06:02
Nit: `and opts.get('change')` is unnecessary here.
f.nicolaisen
2017/07/18 12:17:57
How? It could be that the submitter wants the prom
Wladimir Palant
2017/07/18 12:27:18
No, we would get into the prompt case then. And si
f.nicolaisen
2017/07/18 13:46:39
Acknowledged.
| |
| 66 fulltitle = repo[opts['change']].description() | 66 fulltitle = repo[opts['change']].description() |
| 67 opts['title'] = fulltitle.rstrip().split('\n')[0] | 67 opts['title'] = fulltitle.rstrip().split('\n')[0] |
| 68 | 68 |
| 69 if not opts['title'].strip(): | 69 if not opts['title'].strip(): |
| 70 raise error.Abort('No review title given.') | 70 raise error.Abort('No review title given.') |
| 71 | 71 |
| 72 if not opts.get('message'): | 72 if not opts.get('message'): |
| 73 opts['message'] = fulltitle or opts['title'] | 73 opts['message'] = fulltitle or opts['title'] |
| 74 | 74 |
| 75 path = (ui.config('paths', 'default-push') | 75 path = (ui.config('paths', 'default-push') |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 </body> | 160 </body> |
| 161 </html> | 161 </html> |
| 162 ''' % port | 162 ''' % port |
| 163 | 163 |
| 164 # Run the upload tool | 164 # Run the upload tool |
| 165 issue, patchset = scope['RealMain']([upload_path] + args) | 165 issue, patchset = scope['RealMain']([upload_path] + args) |
| 166 | 166 |
| 167 # Wait for the page to check in and retrieve issue URL | 167 # Wait for the page to check in and retrieve issue URL |
| 168 if server: | 168 if server: |
| 169 server.handle_request() | 169 server.handle_request() |
| LEFT | RIGHT |