53aadb5be2b6

cli: automatically clone the review data with --web
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 20 Jul 2010 19:59:33 -0400
parents 9cd3f1057ae1
children 2f55173bca52
branches/tags (none)
files docs/index.rst docs/overview.rst review/cli.py

Changes

--- a/docs/index.rst	Tue Jul 20 19:43:02 2010 -0400
+++ b/docs/index.rst	Tue Jul 20 19:59:33 2010 -0400
@@ -34,11 +34,9 @@
 Now you need a repository that has code review enabled.  Luckily, you've
 already got one -- hg-review uses itself for code review. 
 
-``cd`` into the directory you cloned hg-review to and initialize the review
-data, then start the web interface::
+``cd`` into the directory you cloned hg-review to and start the web interface::
 
     cd hg-review
-    hg review --init
     hg review --web
 
 Open http://localhost:8080/ in your browser of choice and poke around. Check
--- a/docs/overview.rst	Tue Jul 20 19:43:02 2010 -0400
+++ b/docs/overview.rst	Tue Jul 20 19:59:33 2010 -0400
@@ -38,11 +38,9 @@
 '''''''''''''''''''''''''''''''''''
 
 If you want to work with a repository that already has code review set up all
-you need to do is cd into that repository, pull down the review data, and fire
-up the web ui::
+you need to do is cd into that repository, and fire up the web ui::
 
     cd ~/src/someproject
-    hg review --init
     hg review --web
 
 Once that's done you can visit http://localhost:8080/ in your browser to start
--- a/review/cli.py	Tue Jul 20 19:43:02 2010 -0400
+++ b/review/cli.py	Tue Jul 20 19:59:33 2010 -0400
@@ -75,6 +75,10 @@
     allow_anon = opts.pop('allow_anon')
     address = opts.pop('address')
     port = int(opts.pop('port'))
+
+    if api.review_initialized(repo) and not api.local_datastore_exists(repo):
+        _init_command(ui, repo, remote_path=None)
+
     rd = _get_datastore(ui, repo)
 
     import web