c28a2dae28ef initial-docs

docs: flesh out the web ui deployment docs
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 03 Jul 2010 15:33:59 -0400
parents c631e35b5827
children bb3928ffbda3
branches/tags initial-docs
files docs/webui.rst

Changes

--- a/docs/webui.rst	Sat Jul 03 15:12:25 2010 -0400
+++ b/docs/webui.rst	Sat Jul 03 15:33:59 2010 -0400
@@ -60,6 +60,9 @@
 to provide a public interface. This will let people can comment easily without
 using the extension (or even cloning your project).
 
+Initial Deployment
+''''''''''''''''''
+
 You can use any WSGI server you like to provide a public instance of hg-review.
 Before you start you'll need to have Mercurial installed on your web server.
 
@@ -74,13 +77,17 @@
 
     hg clone http://bitbucket.org/sjl/hg-review/
 
-Grab a copy of your project and configure it to use the hg-review extension::
+Grab a copy of your project and configure it to use the hg-review extension as
+well as the built-in `fetch
+<http://mercurial.selenic.com/wiki/FetchExtension>`_ extension (to
+automatically merge updates)::
 
-    hg clone http://bitbucket.org/you/yourproject/
+    hg clone -U http://bitbucket.org/you/yourproject/
     cd yourproject
 
     echo '[extensions]' >> .hg/hgrc
     echo 'review = /var/www/myproject-review-interface/hg-review/review' >> .hg/hgrc
+    echo 'fetch = ' >> .hg/hgrc
 
 Use hg-review to pull down the review data::
 
@@ -114,3 +121,43 @@
 you do that depends on your WSGI server. A sample configuration file for
 `Gunicorn <http://gunicorn.org/>`_ is provided in
 ``contrib/deploy/gunicorn.conf.py``.
+
+Updating the Data
+'''''''''''''''''
+
+You'll want to keep the review data for this interface current so users can see
+all the latest comments and signoffs.
+
+To do this you simply need to pull in the main repository (to receive new
+changesets in your project) and fetch in the review data repository (to receive
+new comments and signoffs)::
+
+    hg -R /var/www/myproject-review-interface/ pull
+    hg -R /var/www/myproject-review-interface/.hg/review fetch
+
+New comments and signoffs will be visible immediately -- you don't need to
+restart your WSGI server.
+
+You'll probably want to set this up as a cron job or use a hook of some kind
+to automate the updates.
+
+If you allow anonymous comments and want people that are using the extension
+locally (instead of this public instance) to see these comments, you'll need to
+*fetch and push* the review data repo as well::
+
+    hg -R /var/www/myproject-review-interface/.hg/review/ fetch
+    hg -R /var/www/myproject-review-interface/.hg/review/ push
+
+hg-review is designed to never encounter merge conflicts with its data, but
+there's always the chance that someone has done something manually that could
+cause a problem.
+
+If your interface doesn't seem to be receiving new comments/signoffs you'll
+want to take a look at the review data repository to see what's wrong::
+
+    cd /var/www/myproject-review-interface/.hg/review
+    hg heads
+
+There should only ever be one head in this repository. If there are more you'll
+need to merge them (and push back to your public review data repo so others
+won't encounter the same problem).