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 description = repo[opts['change']].description() | 64 opts['title'] = ui.prompt('New review title: ', '') |
65 else: | 65 elif not opts.get('title'): |
66 description = ui.prompt('New review title: ', '') | |
Wladimir Palant
2017/07/17 13:20:37
The variable description is being assigned but nev
f.nicolaisen
2017/07/17 13:43:41
Acknowledged.
| |
67 if not opts.get('title') and opts.get('change'): | |
68 fulltitle = repo[opts['change']].description() | 66 fulltitle = repo[opts['change']].description() |
69 opts['title'] = fulltitle.rstrip().split('\n')[0] | 67 opts['title'] = fulltitle.rstrip().split('\n')[0] |
Wladimir Palant
2017/07/17 13:20:37
So we are no longer asking for a title if neither
f.nicolaisen
2017/07/17 13:43:40
Acknowledged.
| |
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'] = opts['title'] if fulltitle is None else fulltitle | 73 opts['message'] = fulltitle or opts['title'] |
Wladimir Palant
2017/07/17 13:20:37
How about:
opts['message'] = fulltitle or opts['t
f.nicolaisen
2017/07/17 13:43:40
Acknowledged.
| |
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) |
80 if match: | 79 if match: |
81 opts['base_url'] = 'https://' + match.group(1) | 80 opts['base_url'] = 'https://' + match.group(1) |
82 | 81 |
83 # Make sure there is at least one reviewer | 82 # Make sure there is at least one reviewer |
84 if not opts.get('reviewers'): | 83 if not opts.get('reviewers'): |
(...skipping 76 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 |