OLD | NEW |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 else: | 60 else: |
61 raise error.Abort('What should be reviewed? Either --revision or --chang
e is required.') | 61 raise error.Abort('What should be reviewed? Either --revision or --chang
e is required.') |
62 | 62 |
63 if not opts.get('issue'): | 63 if not opts.get('issue'): |
64 # New issue, make sure title and message are set | 64 # New issue, make sure title and message are set |
65 fulltitle = None | 65 fulltitle = None |
66 | 66 |
67 if not opts.get('title') and not opts.get('change'): | 67 if not opts.get('title') and not opts.get('change'): |
68 opts['title'] = ui.prompt('New review title: ', '') | 68 opts['title'] = ui.prompt('New review title: ', '') |
69 elif not opts.get('title'): | 69 elif not opts.get('title'): |
70 fulltitle = repo[opts['change']].description() | 70 rev_no = repo.revs(opts['change']).first() |
| 71 fulltitle = repo[rev_no].description() |
71 opts['title'] = fulltitle.rstrip().split('\n')[0] | 72 opts['title'] = fulltitle.rstrip().split('\n')[0] |
72 | 73 |
73 if not opts['title'].strip(): | 74 if not opts['title'].strip(): |
74 raise error.Abort('No review title given.') | 75 raise error.Abort('No review title given.') |
75 | 76 |
76 if not opts.get('message'): | 77 if not opts.get('message'): |
77 opts['message'] = fulltitle or opts['title'] | 78 opts['message'] = fulltitle or opts['title'] |
78 | 79 |
79 path = (ui.config('paths', 'default-push') | 80 path = (ui.config('paths', 'default-push') |
80 or ui.config('paths', 'default') | 81 or ui.config('paths', 'default') |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 </body> | 165 </body> |
165 </html> | 166 </html> |
166 ''' % port | 167 ''' % port |
167 | 168 |
168 # Run the upload tool | 169 # Run the upload tool |
169 issue, patchset = scope['RealMain']([upload_path] + args) | 170 issue, patchset = scope['RealMain']([upload_path] + args) |
170 | 171 |
171 # Wait for the page to check in and retrieve issue URL | 172 # Wait for the page to check in and retrieve issue URL |
172 if server: | 173 if server: |
173 server.handle_request() | 174 server.handle_request() |
OLD | NEW |