a55ffc78928c

Add a friendlier error message when you need to --init
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 11 Jun 2010 19:59:34 -0400
parents 2e5d4343bf8f
children 9f5c608a45a1 a909c2ba47f0
branches/tags (none)
files review/extension_ui.py review/messages.py

Changes

--- a/review/extension_ui.py	Fri Jun 11 19:55:16 2010 -0400
+++ b/review/extension_ui.py	Fri Jun 11 19:59:34 2010 -0400
@@ -98,7 +98,10 @@
     rev = opts.pop('rev')
     context = int(opts.pop('unified'))
 
-    rd = ReviewDatastore(ui, repo)
+    try:
+        rd = ReviewDatastore(ui, repo)
+    except UninitializedDatastore:
+        raise util.Abort(messages.NO_DATA_STORE)
     cset = repo[rev]
     rcset = rd[rev]
 
--- a/review/messages.py	Fri Jun 11 19:55:16 2010 -0400
+++ b/review/messages.py	Fri Jun 11 19:59:34 2010 -0400
@@ -5,6 +5,10 @@
 unit tests much easier.
 
 """
+NO_DATA_STORE = """\
+the review data has not been initialized!
+run "hg review --init" to do so
+"""
 
 INIT_START = """\
 initializing the code review data store and config
@@ -107,4 +111,4 @@
 
 WEB_START = """\
 starting CherryPy web server
-"""
\ No newline at end of file
+"""