376: cli: automatically clone the review data with --web by Steve Losh
cli: automatically clone the review data with --web
No changeset-level comments yet…
Add a comment on this changeset
Signoffs
No signoffs yet…
Files
ZG9jcy9pbmRleC5yc3Q=
docs/index.rst ↓
| … skipped 31 lines … | ||
| 31 | review = [path to]/hg-review/review/ |
|
| 32 | |
|
| 33 | Now you need a repository that has code review enabled. Luckily, you've |
|
| 34 | already got one -- hg-review uses itself for code review. |
|
| 35 | |
|
| 36 | - | ``cd`` into the directory you cloned hg-review to and initialize the review |
| 37 | - | data, then start the web interface:: |
| 38 | + | ``cd`` into the directory you cloned hg-review to and start the web interface:: |
| 39 | |
|
| 40 | cd hg-review |
|
| 41 | - | hg review --init |
| 42 | hg review --web |
|
| 43 | |
|
| 44 | Open http://localhost:8080/ in your browser of choice and poke around. Check |
|
| 45 | out the :doc:`Overview </overview>` when you're ready to learn more. |
|
| 46 | |
|
| … skipped 27 lines … | ||
ZG9jcy9vdmVydmlldy5yc3Q=
docs/overview.rst ↓
| … skipped 35 lines … | ||
| 35 | |
|
| 36 | Projects with Existing Code Reviews |
|
| 37 | ''''''''''''''''''''''''''''''''''' |
|
| 38 | |
|
| 39 | If you want to work with a repository that already has code review set up all |
|
| 40 | - | you need to do is cd into that repository, pull down the review data, and fire |
| 41 | - | up the web ui:: |
| 42 | + | you need to do is cd into that repository, and fire up the web ui:: |
| 43 | |
|
| 44 | cd ~/src/someproject |
|
| 45 | - | hg review --init |
| 46 | hg review --web |
|
| 47 | |
|
| 48 | Once that's done you can visit http://localhost:8080/ in your browser to start |
|
| 49 | reviewing. |
|
| 50 | |
|
| … skipped 48 lines … | ||
cmV2aWV3L2NsaS5weQ==
review/cli.py ↓
| … skipped 72 lines … | ||
| 72 | ui.note(messages.WEB_START) |
|
| 73 | read_only = opts.pop('read_only') |
|
| 74 | allow_anon = opts.pop('allow_anon') |
|
| 75 | address = opts.pop('address') |
|
| 76 | port = int(opts.pop('port')) |
|
| 77 | + | |
| 78 | + | if api.review_initialized(repo) and not api.local_datastore_exists(repo): |
| 79 | + | _init_command(ui, repo, remote_path=None) |
| 80 | + | |
| 81 | rd = _get_datastore(ui, repo) |
|
| 82 | |
|
| 83 | import web |
|
| 84 | web.load_interface(ui, repo, read_only=read_only, allow_anon=allow_anon, |
|
| 85 | address=address, port=port, open=False) |
|
| … skipped 348 lines … | ||