Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: hgreview.py

Issue 29352960: Issue 4319 - [hgreview] Make sure reviews for the initial repository revision can be created (Closed) Base URL: https://hg.adblockplus.org/codingtools/
Patch Set: Created Sept. 13, 2016, 7:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 29 matching lines...) Expand all
40 args.append('--verbose') 40 args.append('--verbose')
41 elif ui.quiet: 41 elif ui.quiet:
42 args.append('--quiet') 42 args.append('--quiet')
43 43
44 if not opts.get('issue') or opts.get('message'): 44 if not opts.get('issue') or opts.get('message'):
45 args.append('--send_mail') 45 args.append('--send_mail')
46 46
47 if opts.get('revision') and opts.get('change'): 47 if opts.get('revision') and opts.get('change'):
48 raise error.Abort('Ambiguous revision range, only one of --revision and --change can be specified.') 48 raise error.Abort('Ambiguous revision range, only one of --revision and --change can be specified.')
49 if opts.get('change'): 49 if opts.get('change'):
50 args.extend(['--rev', '{0}^:{0}'.format(opts['change'])]) 50 rev = repo[opts['change']]
51 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)])
51 elif opts.get('revision'): 52 elif opts.get('revision'):
52 args.extend(['--rev', opts['revision']]) 53 args.extend(['--rev', opts['revision']])
53 else: 54 else:
54 raise error.Abort('What should be reviewed? Either --revision or --chang e is required.') 55 raise error.Abort('What should be reviewed? Either --revision or --chang e is required.')
55 56
56 if not opts.get('issue'): 57 if not opts.get('issue'):
57 # New issue, make sure title and message are set 58 # New issue, make sure title and message are set
58 if not opts.get('title') and opts.get('change'): 59 if not opts.get('title') and opts.get('change'):
59 opts['title'] = repo[opts['change']].description() 60 opts['title'] = repo[opts['change']].description()
60 if not opts.get('title'): 61 if not opts.get('title'):
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 </body> 149 </body>
149 </html> 150 </html>
150 ''' % port 151 ''' % port
151 152
152 # Run the upload tool 153 # Run the upload tool
153 issue, patchset = scope['RealMain']([upload_path] + args) 154 issue, patchset = scope['RealMain']([upload_path] + args)
154 155
155 # Wait for the page to check in and retrieve issue URL 156 # Wait for the page to check in and retrieve issue URL
156 if server: 157 if server:
157 server.handle_request() 158 server.handle_request()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld