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

Side by Side Diff: hgreview.py

Issue 29349225: Issue 4313 - hg review shouldn't fail if the repository has no URL configured (Closed)
Patch Set: Created Aug. 8, 2016, 7:06 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 opts['title'] = repo[opts['change']].description() 59 opts['title'] = repo[opts['change']].description()
60 if not opts.get('title'): 60 if not opts.get('title'):
61 opts['title'] = ui.prompt('New review title: ', '') 61 opts['title'] = ui.prompt('New review title: ', '')
62 if not opts['title'].strip(): 62 if not opts['title'].strip():
63 raise error.Abort('No review title given.') 63 raise error.Abort('No review title given.')
64 64
65 if not opts.get('message'): 65 if not opts.get('message'):
66 opts['message'] = opts['title'] 66 opts['message'] = opts['title']
67 67
68 path = ui.config('paths', 'default-push') or ui.config('paths', 'default ') 68 path = ui.config('paths', 'default-push') or ui.config('paths', 'default ')
69 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) 69 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path or '')
Vasily Kuznetsov 2016/08/16 08:50:48 Perhaps it would make the code a bit more clear if
Wladimir Palant 2016/08/16 10:37:11 Done.
70 if match: 70 if match:
71 opts['message'] = '{0}\n\nRepository: {1}'.format( 71 opts['message'] = '{0}\n\nRepository: {1}'.format(
72 opts['message'].strip(), 72 opts['message'].strip(),
73 match.group(1) 73 match.group(1)
74 ) 74 )
75 75
76 # Make sure there is at least one reviewer 76 # Make sure there is at least one reviewer
77 if not opts.get('reviewers'): 77 if not opts.get('reviewers'):
78 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', '') 78 opts['reviewers'] = ui.prompt('Reviewers (comma-separated): ', '')
79 if not opts['reviewers'].strip(): 79 if not opts['reviewers'].strip():
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 </body> 149 </body>
150 </html> 150 </html>
151 ''' % port 151 ''' % port
152 152
153 # Run the upload tool 153 # Run the upload tool
154 issue, patchset = scope['RealMain']([upload_path] + args) 154 issue, patchset = scope['RealMain']([upload_path] + args)
155 155
156 # Wait for the page to check in and retrieve issue URL 156 # Wait for the page to check in and retrieve issue URL
157 if server: 157 if server:
158 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