How do I get a local copy of the review's code for evaluation?
Swarm manages one or more changelists containing shelved copies of all of the files belonging to a specific review. You can unshelve the files to receive a copy of the review's code, or you can click the to download a ZIP archive containing all of the review's files.
Determine the changelist containing the review's files
-
Visit the review's page.
-
The current review version's changelist appears in the file list heading:
In this example, the changelist is
697707
. You use the identified changelist in place of shelved changelist below.
Note
Swarm can version file updates in reviews. For more information, see Review display.
Using P4
For a shelved changelist, use a command-line shell and type:
$ p4 unshelve -s shelved changelist
For a committed changelist, use a command-line shell and type:
$ p4 sync @committed changelist
Note
Your client's view mappings need to include the changelist's path.
Using P4V
For a shelved changelist:
-
Select .
-
Change the select box to .
-
Type in the shelved changelist number and click .
-
Select the files in the Shelved Files area.
-
Context-click, and select .
-
Click .
For a committed changelist:
-
Select .
-
Change the select box to .
-
Type in the submitted changelist number and click .
-
Select the files in the Files area.
-
Context-click, and select .
-
Click .
Using Git Fusion
Git Fusion-initiated reviews include the Git logo beside the main review identifier. This indicator is important because Perforce users cannot update Git Fusion-initiated reviews.
In the following example, the current local task branch is
task1
, the target branch is
master
, the review id is
773273
, the Git Fusion hostname is
gfserver
, and the remote repo name is
p4gf_repo
.
-
Fetch the review's head version:
$ git fetch --prune origin From
gfserver
:p4gf_repo
* [new_branch] review/master
/773273
-> origin/review/master
/773273
x [deleted] (none) -> origin/review/dev
/newThe
--prune
option lets the local Git repo delete the unwantedreview/
reference created by the initial git push originmaster
/newtask1
:review/master
/new command. -
Check out the review's head version:
$ git checkout review/
master
/773273
Important
You can only update Git Fusion-initiated reviews using Git Fusion.
Tip
For more information on Git Fusion, see the Git Fusion Guide
Downloading a ZIP archive
When the zip command-line tool is available, Swarm can provide a ZIP archive containing all of the files in a review. The version of the files downloaded matches those displayed when using the Review Timeline.
Note
The zip command-line tool is not available.
button does not appear if theWhen you click the
button, Swarm performs the following steps:-
scan the review's files, to determine if you have permission to access their contents (according to the Helix Versioning Engine protections), and if the total file size is small enough to be processed by Swarm.
-
sync the file contents to the Swarm server from the Helix Versioning Engine.
-
create the ZIP archive by compressing the file content.
-
start a download of the generated ZIP archive.
You might not see all of the above steps; Swarm caches the resulting ZIP archives so that repeated requests to download the same review files can skip the sync/compress steps whenever possible.
If an error occurs while scanning, syncing, or compressing, Swarm indicates the error.
For information on the configuration for ZIP archives, see Archives configuration.