hg-review provides a command line interface. Except for initializing the review data, starting the web ui, and possibly some scripting, you’ll probably want to use the web interface for most tasks.
When you enable the hg-review extension Mercurial will gain a new command: review. This command on its own will display review data for a changeset, but it also has several subcommands detailed below.
You can always get help on a given topic right from the command line with hg help review or hg help review-topic.
View code review data for a changeset. Usage:
hg review [-r REV] [-U CONTEXT] [--quiet] [FILE]
Diffs of all changed files will be shown with comments inline.
The line numbers printed are the ones that should be used to add line-level comments.
Options:
Initialize code review for a repository. Usage:
hg review --init --remote-path PATH
When run for the first time in a project, it will do two things:
The --remote-path option is required and specifies the path where the canonical code review data for this project will live. This is the path that will be cloned when someone else runs hg review --init on the project.
Options:
Add a code review comment for a changeset. Usage:
hg review --comment [-m MESSAGE] [--mdown] [-r REV] [-l LINES] [FILE]
If no files are given the comment will be attached to the changeset as a whole.
If one or more files are given but no lines are given, the comment will be attached to each file as a whole.
If a file is given and lines are given the comment will be attached to those specific lines. Lines should be specified as a comma-separated list of line numbers (as numbered in the output of “hg review”), such as 3 or 2,3.
Options:
Add a code review signoff for a changeset. Usage:
hg review --signoff [-m MESSAGE] [--mdown] [--yes | --no] [-r REV]
The --yes and --no options can be used to indicate whether you think the changeset is “good” or “bad”.
It’s up to the collaborators of each individual project to decide exactly what that means. If neither option is given the signoff will be marked as “neutral”.
Options:
Edit a comment or signoff. Usage:
hg review --edit IDENTIFIER [--yes | --no] [-m MESSAGE] [-l LINES] [--mdown] [FILE]
Edit the comment or changeset with the given identifier.
You can find the identifier of the item you would like to edit by running hg review --verbose to display identifiers.
Any other options given (such as --message, --yes or filenames) will replace the content of the item you edit.
Check the review status of a changeset. Usage:
hg review --check [-r REV] [--no-nos] [--yeses NUM] [--seen]
Check that the given changeset “passes” the given tests of review status. If no tests are given an error is returned.
Tests are checked in the following order:
If any tests fail the command returns a status of 1 with a message describing the failure on stderr, otherwise it returns 0 and prints nothing.
Start the web interface. Usage:
hg review --web [--read-only] [--allow-anon] [--address ADDRESS] [--port PORT]
Visit http://localhost:8080/ (replace the port number if you specified a different port) in a modern browser of your choice to use the web interface.
Use Ctrl+C to stop the interface.
Options: