OLD | NEW |
1 import BaseHTTPServer | 1 import BaseHTTPServer |
2 import os | 2 import os |
3 import random | 3 import random |
4 import re | 4 import re |
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 22 matching lines...) Expand all Loading... |
33 updating a review mails will only be sent if a message is given. | 33 updating a review mails will only be sent if a message is given. |
34 ''' | 34 ''' |
35 args = ['--oauth2', '--server', SERVER] | 35 args = ['--oauth2', '--server', SERVER] |
36 if ui.debugflag: | 36 if ui.debugflag: |
37 args.append('--noisy') | 37 args.append('--noisy') |
38 elif ui.verbose: | 38 elif ui.verbose: |
39 args.append('--verbose') | 39 args.append('--verbose') |
40 elif ui.quiet: | 40 elif ui.quiet: |
41 args.append('--quiet') | 41 args.append('--quiet') |
42 | 42 |
43 if opts.get('issue') or opts.get('message'): | 43 if not opts.get('issue') or opts.get('message'): |
44 args.append('--send_mail') | 44 args.append('--send_mail') |
45 | 45 |
46 if opts.get('revision') and opts.get('change'): | 46 if opts.get('revision') and opts.get('change'): |
47 raise error.Abort('Ambiguous revision range, only one of --revision and --ch
ange can be specified.') | 47 raise error.Abort('Ambiguous revision range, only one of --revision and --ch
ange can be specified.') |
48 if opts.get('change'): | 48 if opts.get('change'): |
49 args.extend(['--rev', '{0}^:{0}'.format(opts['change'])]) | 49 args.extend(['--rev', '{0}^:{0}'.format(opts['change'])]) |
50 elif opts.get('revision'): | 50 elif opts.get('revision'): |
51 args.extend(['--rev', opts['revision']]) | 51 args.extend(['--rev', opts['revision']]) |
52 else: | 52 else: |
53 raise error.Abort('What should be reviewed? Either --revision or --change is
required.') | 53 raise error.Abort('What should be reviewed? Either --revision or --change is
required.') |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 def do_GET(self): | 117 def do_GET(self): |
118 self.send_response(200) | 118 self.send_response(200) |
119 self.send_header('Content-type', 'text/javascript') | 119 self.send_header('Content-type', 'text/javascript') |
120 self.end_headers() | 120 self.end_headers() |
121 self.wfile.write('location.href = "{0}";'.format(SERVER + '/' + issue)) | 121 self.wfile.write('location.href = "{0}";'.format(SERVER + '/' + issue)) |
122 def log_message(*args, **kwargs): | 122 def log_message(*args, **kwargs): |
123 pass | 123 pass |
124 | 124 |
125 server = BaseHTTPServer.HTTPServer(('localhost', port), RequestHandler) | 125 server = BaseHTTPServer.HTTPServer(('localhost', port), RequestHandler) |
126 server.handle_request() | 126 server.handle_request() |
OLD | NEW |