Doc downloads (PDF, HTML & XML)
[Crucible Knowledge Base]
You can use the Review CLI tool to create reviews in Crucible, for patches and commits, directly from your terminal. It takes the uncommitted changes in your workspace and creates a review for them in Crucible. The Review CLI tool may be especially useful if:
You can use the tool on Windows, Linux and Mac OS X, for repositories that are managed in:
The tool supports Crucible 3.0, and later versions. Python 2.7 must be installed on your local machine (Python 3 is not supported).
You can use the tool to create new reviews, and to update existing reviews with new patches.
On this page:
Related pages:
Download the Review CLI tool from either of the following locations in Crucible:
The script comes pre-configured for the user for the given SCM server.
Copy the script to a location somewhere in your system path, for greatest ease of use.
Python 2.7 is required.
Python 2.7 should come with your distribution. If not, or if 2.7 isn’t installed, you will need to install the appropriate package. Please refer to your package manager for the appropriate version.
You can install Python by running the latest Python 2.7 Installer for Windows.
Python 2.7 should come with any modern version of MacOS X. You can also download Python 2.7 from http://www.python.org/getit/.
To create a review using the Review CLI tool, run the script from a directory under SCM control that has local, uncommitted changes. The changes will be submitted to Crucible for review.
Call the script with the following command:
crucible.py <arguments list>
The Review CLI syntax is consistent with that for Crucible and FishEye smart commits. Examples of syntax usage are provided in the following table:
Action | Syntax | Result |
---|---|---|
View usage help | crucible.py --help | Displays the help with descriptions of all the valid commandline arguments |
Create a pre-commit review interactively | crucible.py | Gets the patch from the current SCM, prompts for the project and review title, and creates a draft review |
Create a pre-commit review with a given project and title | crucible.py -m "the review title" CR-FE | Gets the patch from the current SCM, creates a draft review in the CR-FE project with the given title |
Create a pre-commit review with moderator and reviewers | crucible.py CR-FE @matt @joe --moderator ted | Gets the patch from the current SCM, creates a review in the CR-FE project, adds matt and joe as the reviewers and ted as a moderator, starts the review |
Create a pre-commit review anchored to a specific repository | crucible.py -r repo1 | Creates a pre-commit review interactively, trying to anchor the patch to the given repository |
Add a patch to a review | crucible.py CR-FE-1204 | Gets the patch from the current SCM and adds it to the review CR-FE-1204 |
Create a review from diff output | hg diff | crucible.py | Creates a pre-commit review interactively, taking the output of the first command as a patch |
Create a review from a diff file | crucible.py -f file.diff | Creates a pre-commit review interactively, taking the output of the patch from the given file |