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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 elif ui.quiet: | 45 elif ui.quiet: |
46 args.append('--quiet') | 46 args.append('--quiet') |
47 | 47 |
48 if (not opts.get('no_mail') and | 48 if (not opts.get('no_mail') and |
49 (not opts.get('issue') or opts.get('message'))): | 49 (not opts.get('issue') or opts.get('message'))): |
50 args.append('--send_mail') | 50 args.append('--send_mail') |
51 | 51 |
52 if opts.get('revision') and opts.get('change'): | 52 if opts.get('revision') and opts.get('change'): |
53 raise error.Abort('Ambiguous revision range, only one of --revision and
--change can be specified.') | 53 raise error.Abort('Ambiguous revision range, only one of --revision and
--change can be specified.') |
54 if opts.get('change'): | 54 if opts.get('change'): |
55 rev = repo[opts['change']] | 55 rev_no = repo.revs(opts['change']).first() |
| 56 rev = repo[rev_no] |
56 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)]) | 57 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)]) |
57 elif opts.get('revision'): | 58 elif opts.get('revision'): |
58 args.extend(['--rev', opts['revision']]) | 59 args.extend(['--rev', opts['revision']]) |
59 else: | 60 else: |
60 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.') |
61 | 62 |
62 if not opts.get('issue'): | 63 if not opts.get('issue'): |
63 # New issue, make sure title and message are set | 64 # New issue, make sure title and message are set |
64 fulltitle = None | 65 fulltitle = None |
65 | 66 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 </body> | 164 </body> |
164 </html> | 165 </html> |
165 ''' % port | 166 ''' % port |
166 | 167 |
167 # Run the upload tool | 168 # Run the upload tool |
168 issue, patchset = scope['RealMain']([upload_path] + args) | 169 issue, patchset = scope['RealMain']([upload_path] + args) |
169 | 170 |
170 # Wait for the page to check in and retrieve issue URL | 171 # Wait for the page to check in and retrieve issue URL |
171 if server: | 172 if server: |
172 server.handle_request() | 173 server.handle_request() |
OLD | NEW |