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

Unified 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: follow Vasily's suggestions Created Jan. 15, 2017, 10:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: hgreview.py
===================================================================
--- a/hgreview.py
+++ b/hgreview.py
@@ -58,15 +58,18 @@
if not opts.get('issue'):
# New issue, make sure title and message are set
- if not opts.get('title') and opts.get('change'):
- opts['title'] = repo[opts['change']].description()
+ if opts.get('change'):
+ description = repo[opts['change']].description()
+ else:
+ description = ui.prompt('New review title: ', '')
Wladimir Palant 2017/01/16 10:11:43 The logic change here will have the effect that th
Vasily Kuznetsov 2017/01/16 10:46:07 Yes, that's right. I also missed this case when su
Wladimir Palant 2017/01/16 21:50:50 This isn't the right thing to do either. We should
Vasily Kuznetsov 2017/01/16 22:39:05 My thinking was that it's quite unlikely that some
Wladimir Palant 2017/01/17 10:30:17 It's not impossible however - typically the data c
if not opts.get('title'):
- opts['title'] = ui.prompt('New review title: ', '')
+ # Drop everything but the first line of description in title
+ opts['title'] = description.rstrip().split('\n')[0]
if not opts['title'].strip():
raise error.Abort('No review title given.')
if not opts.get('message'):
- opts['message'] = opts['title']
+ opts['message'] = description
path = (ui.config('paths', 'default-push')
or ui.config('paths', 'default')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld