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' |
11 UPLOADTOOL_URL = SERVER + '/static/upload.py' | 11 UPLOADTOOL_URL = SERVER + '/static/upload.py' |
12 | 12 |
13 cmdtable = {} | 13 cmdtable = {} |
14 command = cmdutil.command(cmdtable) | 14 try: |
15 | 15 command = cmdutil.command(cmdtable) |
| 16 except Exception: |
| 17 from mercurial import registrar |
| 18 command = registrar.command(cmdtable) |
16 | 19 |
17 @command('review', | 20 @command('review', |
18 [ | 21 [ |
19 ('i', 'issue', '', 'If given, adds a patch set to this review, othe
rwise create a new one.', 'ISSUE'), | 22 ('i', 'issue', '', 'If given, adds a patch set to this review, othe
rwise create a new one.', 'ISSUE'), |
20 ('r', 'revision', '', 'Revision to diff against or a revision range
to upload.', 'REV'), | 23 ('r', 'revision', '', 'Revision to diff against or a revision range
to upload.', 'REV'), |
21 ('c', 'change', '', 'A single revision to upload.', 'REV'), | 24 ('c', 'change', '', 'A single revision to upload.', 'REV'), |
22 ('t', 'title', '', 'New review subject or new patch set title.', 'T
ITLE'), | 25 ('t', 'title', '', 'New review subject or new patch set title.', 'T
ITLE'), |
23 ('m', 'message', '', 'New review description or new patch set messa
ge.', 'MESSAGE'), | 26 ('m', 'message', '', 'New review description or new patch set messa
ge.', 'MESSAGE'), |
24 ('w', 'reviewers', '', 'Add reviewers (comma separated email addres
ses or @adblockplus.org user names).', 'REVIEWERS'), | 27 ('w', 'reviewers', '', 'Add reviewers (comma separated email addres
ses or @adblockplus.org user names).', 'REVIEWERS'), |
25 ('', 'cc', '', 'Add CC (comma separated email addresses or @adblock
plus.org user names).', 'CC'), | 28 ('', 'cc', '', 'Add CC (comma separated email addresses or @adblock
plus.org user names).', 'CC'), |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 </body> | 163 </body> |
161 </html> | 164 </html> |
162 ''' % port | 165 ''' % port |
163 | 166 |
164 # Run the upload tool | 167 # Run the upload tool |
165 issue, patchset = scope['RealMain']([upload_path] + args) | 168 issue, patchset = scope['RealMain']([upload_path] + args) |
166 | 169 |
167 # Wait for the page to check in and retrieve issue URL | 170 # Wait for the page to check in and retrieve issue URL |
168 if server: | 171 if server: |
169 server.handle_request() | 172 server.handle_request() |
OLD | NEW |