--- a/review/tests/test_init.py Sun Oct 04 19:09:55 2009 -0400
+++ b/review/tests/test_init.py Sun Oct 04 19:19:01 2009 -0400
@@ -3,6 +3,7 @@
import os
from .. import messages
+from mercurial import util as hgutil
@with_setup(setup_sandbox, teardown_sandbox)
@@ -88,3 +89,17 @@
assert 'local = codereview' in hgr
assert 'remote = ../code-review' in hgr
+
+@with_setup(setup_sandbox, teardown_sandbox)
+def test_init_twice():
+ sandbox = get_sandbox_repo()
+
+ try:
+ review(init=True)
+ review(init=True)
+ except hgutil.Abort, e:
+ error = str(e)
+ assert messages.INIT_EXISTS_UNCOMMITTED in error
+ else:
+ assert False, 'The correct error message was not printed.'
+