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

Delta Between Two Patch Sets: hgreview.py

Issue 29363768: Fixes 4662 - [hgreview] Add an option for suppressing the email after upload (Closed) Base URL: https://bitbucket.org/fhd/codingtools
Left Patch Set: Only print a warning when no reviewers have been specified Created Nov. 23, 2016, 4:05 p.m.
Right Patch Set: Use ui.status instead of print Created Nov. 23, 2016, 5:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 path = (ui.config('paths', 'default-push') 71 path = (ui.config('paths', 'default-push')
72 or ui.config('paths', 'default') 72 or ui.config('paths', 'default')
73 or '') 73 or '')
74 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) 74 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path)
75 if match: 75 if match:
76 opts['base_url'] = 'https://' + match.group(1) 76 opts['base_url'] = 'https://' + match.group(1)
77 77
78 # Make sure there is at least one reviewer 78 # Make sure there is at least one reviewer
79 if not opts.get('reviewers'): 79 if not opts.get('reviewers'):
80 if opts.get('no_mail'): 80 if opts.get('no_mail'):
81 print 'No reviewers specified, edit the review to add some.' 81 ui.status('No reviewers specified, edit the review to add '
Wladimir Palant 2016/11/23 16:30:14 Please use ui.status() rather than print, this wil
Felix Dahlke 2016/11/23 17:21:26 Done.
82 'some.\n')
82 else: 83 else:
83 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', 84 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ',
84 '') 85 '')
85 if not opts['reviewers'].strip(): 86 if not opts['reviewers'].strip():
86 raise error.Abort('No reviewers given.') 87 raise error.Abort('No reviewers given.')
87 88
88 for opt in ('reviewers', 'cc'): 89 for opt in ('reviewers', 'cc'):
89 if opts.get(opt): 90 if opts.get(opt):
90 users = [u if '@' in u else u + '@adblockplus.org' 91 users = [u if '@' in u else u + '@adblockplus.org'
91 for u in re.split(r'\s*,\s*', opts[opt])] 92 for u in re.split(r'\s*,\s*', opts[opt])]
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 </body> 156 </body>
156 </html> 157 </html>
157 ''' % port 158 ''' % port
158 159
159 # Run the upload tool 160 # Run the upload tool
160 issue, patchset = scope['RealMain']([upload_path] + args) 161 issue, patchset = scope['RealMain']([upload_path] + args)
161 162
162 # Wait for the page to check in and retrieve issue URL 163 # Wait for the page to check in and retrieve issue URL
163 if server: 164 if server:
164 server.handle_request() 165 server.handle_request()
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld