Add a changelist to a review
Once a review has been started you can add a changelist to the review. It can be useful to add changelists to an existing review. For example, if follow up changes are made to files in a review or if you need to group a number of changelists under a single review.
The Add Change button in the review heading is used to add a changelist to an existing review. The button is not visible if the review is in a state that is protected from change by the review workflow rules. For details of the On update of a review in an end state rule, see Workflow rules.
The options available in the Add Change dropdown menu depend on whether the review is pre-commit or post-commit:
- Pre-commit reviews:
- Append Pending Changelist: when you add a pending changelist to a review, the files in the changelist are appended to the existing files in the review, see Append a pending changelist to a review.
- Replace with Pending Changelist: when you add a pending changelist to a review, all of the files in the review are replaced with the files in the changelist you are adding to the review, see Replace review with a pending changelist.
- Replace with Committed Changelist: when you add a committed changelist to a review, all of the files in the review are replaced with the files in the changelist you are adding to the review, see Replace review with a committed changelist.
NoteIf you replace a pre-commit review with a committed changelist, the new version of the review will be a post-commit review.
- Post-commit reviews:
- Replace with Pending Changelist: when you add a pending changelist to a review, all of the files in the review are replaced with the files in the changelist you are adding to the review, see Replace review with a pending changelist.
- Replace with Committed Changelist: when you add a committed changelist to a review, all of the files in the review are replaced with the files in the changelist you are adding to the review, see Replace review with a committed changelist.
NoteIf you replace a post-commit review with a pending changelist, the new version of the review will be a pre-commit review.
When the content of a review is changed, Swarm checks to see which branches are in the new revision of the review:
- If a new branch was added to the review:
- Default reviewers on the new branch are added to the review.
- Moderators from the added branch become moderators for the review alongside the existing moderators.
- Only if workflow is enabled: if the new branch is associated with a workflow, the workflow is merged with the existing workflow. The most restrictive workflow is used for the review.
- If a branch is no longer part of the review:
- Reviewers for the review are not changed.
- Moderators from the removed branch no longer moderate the review.
- Only if workflow is enabled: if the branch was associated with a workflow, the branch workflow is removed from the review.
Append a pending changelist to a review
The Append Pending Changelist option is used to add a pending changelist to a pre-commit review.
Example:
- Original review contains the following files: A#1, B#2, C#1, D#1, and E#4
- Changelist contains the following files: A#2, C#3, E#4 (marked for delete), and F#1
- Appending the changelist to the original review generates a new revision of the review that contains the following files: A#2, B#2, C#3, D#1, E#4 (marked for delete), and F#1
Committing a review with Swarm (recommended): Swarm automatically commits the files in the approved revision of the review.
Committing a review outside of Swarm:
Before you commit the review:
- Unshelve the review into the pending changelist associated with the review.
- Reshelve the files in the pending changelist.
- Commit the pending changelist.
- This process ensures that all of the files in the approved revision of the review are committed.
Workflow technology preview feature disabled (default):
Swarm can be configured to automatically check that the files being committed match the files in the approved revision of the review, see the strict trigger option.
Workflow technology preview feature enabled:
Swarm can be configured to automatically check that the files being committed match the files in the approved revision of the review by using the On commit with a review workflow rule. For information about the On commit with a review rule, see Workflow rules.
To append a changelist to a review:
- Click Add Change from the review heading.
- Select Append Pending Changelist from the dropdown menu and the append review dialog is displayed with a list of recent pending changelists:
- Enter the pending changelist number directly in the @ Change box, filter by depot path and user, or select a changelist from the list of recent changelists.
- Click Select to append the changelist to the review, double-click a changelist to do the same.
- The changelist is appended to the review and the review version is updated.
The changelist must not be part of another review, if it is Swarm will reject it.
Replace review with a pending changelist
The Replace with a Pending Changelist option is used to replace the files in a review with the files in a pending changelist.
If you replace a post-commit review with a pending changelist, the new version of the review will be a pre-commit review.
Example:
- Original review contains the following files: A#1, B#2, C#1, D#1, and E#4
- Changelist contains the following files: A#2, C#3, E#4 (marked for delete), and F#1
- Replacing the original review with the changelist generates a new revision of the review that contains the following files: A#2, C#3, E#4 (marked for delete), and F#1
When you replace a review with a changelist, the base versions of the files in the new revision of the review are the base versions of the files in the replacement changelist.
To replace the files in a review with the files in a changelist:
- Click Add Change from the review heading.
- Select Replace with a Pending Changelistfrom the dropdown menu and the replace review dialog is displayed with a list of recent pending changelists:
- Enter the pending changelist number directly in the @ Change box, filter by depot path and user, or select a changelist from the list of recent changelists.
- Click Select to replace the review with the changelist, double-click a changelist to do the same.
- The changelist files replace the files in the review and the review version is updated.
The changelist must not be part of another review, if it is Swarm will reject it.
Replace review with a committed changelist
The Replace with a Committed Changelist option is used to replace the files in a review with the files in a committed changelist.
If you replace a pre-commit review with a committed changelist, the new version of the review will be a post-commit review.
Example:
- Original review contains the following files: A#1, B#2, C#1, D#1, and E#4
- Changelist contains the following files: A#2, C#3, E#4 (marked for delete), and F#1
- Replacing the original review with the changelist generates a new revision of the review that contains the following files: A#2, C#3, E#4 (marked for delete), and F#1
When you replace a review with a changelist, the base versions of the files in the new revision of the review are the base versions of the files in the replacement changelist.
To replace the files in a review with the files in a changelist:
- Click Add Change from the review heading.
- Select Replace with a Committed Changelist from the dropdown menu and the replace review dialog is displayed with a list of recent committed changelists:
- Enter the committed changelist number directly in the @ Change box, filter by depot path and user, or select a changelist from the list of recent changelists.
- Click Select to replace the review with the changelist, double-click a changelist to do the same.
- The changelist files replace the files in the review and the review version is updated.
The changelist must not be part of another review, if it is Swarm will reject it.