| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)]) | 53 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)]) | 
| 54 elif opts.get('revision'): | 54 elif opts.get('revision'): | 
| 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 opts.get('change'): | 63 if not opts.get('title') and not opts.get('change'): | 
| 64 fulltitle = repo[opts['change']].description() | 64 opts['title'] = ui.prompt('New review title: ', '') | 
| 65 else: | 65 elif not opts.get('title'): | 
| 66 fulltitle = ui.prompt('New review title: ', '') | |
| 
 
Wladimir Palant
2017/07/17 14:57:52
So we will be prompting even if --title is given o
 
f.nicolaisen
2017/07/18 11:52:00
Acknowledged.
 
 | |
| 67 if not opts.get('title') and opts.get('change'): | |
| 68 fulltitle = repo[opts['change']].description() | 66 fulltitle = repo[opts['change']].description() | 
| 
 
Wladimir Palant
2017/07/17 14:57:52
Overwriting fulltitle variable with the same value
 
f.nicolaisen
2017/07/18 11:52:00
Acknowledged.
 
 | |
| 69 opts['title'] = fulltitle.rstrip().split('\n')[0] | 67 opts['title'] = fulltitle.rstrip().split('\n')[0] | 
| 68 | |
| 70 if not opts['title'].strip(): | 69 if not opts['title'].strip(): | 
| 71 raise error.Abort('No review title given.') | 70 raise error.Abort('No review title given.') | 
| 72 | 71 | 
| 73 if not opts.get('message'): | 72 if not opts.get('message'): | 
| 74 opts['message'] = fulltitle or opts['title'] | 73 opts['message'] = fulltitle or opts['title'] | 
| 75 | 74 | 
| 76 path = (ui.config('paths', 'default-push') | 75 path = (ui.config('paths', 'default-push') | 
| 77 or ui.config('paths', 'default') | 76 or ui.config('paths', 'default') | 
| 78 or '') | 77 or '') | 
| 79 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) | 78 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 </body> | 160 </body> | 
| 162 </html> | 161 </html> | 
| 163 ''' % port | 162 ''' % port | 
| 164 | 163 | 
| 165 # Run the upload tool | 164 # Run the upload tool | 
| 166 issue, patchset = scope['RealMain']([upload_path] + args) | 165 issue, patchset = scope['RealMain']([upload_path] + args) | 
| 167 | 166 | 
| 168 # Wait for the page to check in and retrieve issue URL | 167 # Wait for the page to check in and retrieve issue URL | 
| 169 if server: | 168 if server: | 
| 170 server.handle_request() | 169 server.handle_request() | 
| LEFT | RIGHT |