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

Side by Side Diff: hgreview.py

Issue 29371804: Noissue - [hgreview] Only use first line of commit message as review title (Closed) Base URL: https://hg.adblockplus.org/codingtools/
Patch Set: Trying Wladimir's idea supporting multiline from command line Created July 14, 2017, 3:14 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if opts.get('change'): 51 if opts.get('change'):
52 rev = repo[opts['change']] 52 rev = repo[opts['change']]
53 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)]) 53 args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)])
54 elif opts.get('revision'): 54 elif opts.get('revision'):
55 args.extend(['--rev', opts['revision']]) 55 args.extend(['--rev', opts['revision']])
56 else: 56 else:
57 raise error.Abort('What should be reviewed? Either --revision or --chang e is required.') 57 raise error.Abort('What should be reviewed? Either --revision or --chang e is required.')
58 58
59 if not opts.get('issue'): 59 if not opts.get('issue'):
60 # New issue, make sure title and message are set 60 # New issue, make sure title and message are set
61 fulltitle = None
62
63 if opts.get('change'):
64 description = repo[opts['change']].description()
65 else:
66 description = ui.prompt('New review title: ', '')
Wladimir Palant 2017/07/17 13:20:37 The variable description is being assigned but nev
f.nicolaisen 2017/07/17 13:43:41 Acknowledged.
61 if not opts.get('title') and opts.get('change'): 67 if not opts.get('title') and opts.get('change'):
62 opts['title'] = repo[opts['change']].description() 68 fulltitle = repo[opts['change']].description()
63 if not opts.get('title'): 69 opts['title'] = fulltitle.rstrip().split('\n')[0]
Wladimir Palant 2017/07/17 13:20:37 So we are no longer asking for a title if neither
f.nicolaisen 2017/07/17 13:43:40 Acknowledged.
64 opts['title'] = ui.prompt('New review title: ', '')
65 if not opts['title'].strip(): 70 if not opts['title'].strip():
66 raise error.Abort('No review title given.') 71 raise error.Abort('No review title given.')
67 72
68 if not opts.get('message'): 73 if not opts.get('message'):
69 opts['message'] = opts['title'] 74 opts['message'] = opts['title'] if fulltitle is None else fulltitle
Wladimir Palant 2017/07/17 13:20:37 How about: opts['message'] = fulltitle or opts['t
f.nicolaisen 2017/07/17 13:43:40 Acknowledged.
70 75
71 path = (ui.config('paths', 'default-push') 76 path = (ui.config('paths', 'default-push')
72 or ui.config('paths', 'default') 77 or ui.config('paths', 'default')
73 or '') 78 or '')
74 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path) 79 match = re.search(r'^(?:https://|ssh://hg@)(.*)', path)
75 if match: 80 if match:
76 opts['base_url'] = 'https://' + match.group(1) 81 opts['base_url'] = 'https://' + match.group(1)
77 82
78 # Make sure there is at least one reviewer 83 # Make sure there is at least one reviewer
79 if not opts.get('reviewers'): 84 if not opts.get('reviewers'):
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 </body> 161 </body>
157 </html> 162 </html>
158 ''' % port 163 ''' % port
159 164
160 # Run the upload tool 165 # Run the upload tool
161 issue, patchset = scope['RealMain']([upload_path] + args) 166 issue, patchset = scope['RealMain']([upload_path] + args)
162 167
163 # Wait for the page to check in and retrieve issue URL 168 # Wait for the page to check in and retrieve issue URL
164 if server: 169 if server:
165 server.handle_request() 170 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