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

Unified 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.
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
@@ -61,17 +61,17 @@ def review(ui, repo, *paths, **opts):
opts['title'] = ui.prompt('New review title: ', '')
if not opts['title'].strip():
raise error.Abort('No review title given.')
if not opts.get('message'):
opts['message'] = opts['title']
path = ui.config('paths', 'default-push') or ui.config('paths', 'default')
- match = re.search(r'^(?:https://|ssh://hg@)(.*)', path)
+ 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.
if match:
opts['message'] = '{0}\n\nRepository: {1}'.format(
opts['message'].strip(),
match.group(1)
)
# Make sure there is at least one reviewer
if not opts.get('reviewers'):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld