Get a local copy of the code in a review 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 Download .zip button on the review to download a ZIP archive containing all of the review's files.

Determine the changelist that contains the files in the review

  1. Visit the review's page.
  2. The current review version's changelist appears in the file list heading.

    Current review version's changelist image

    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:

  1. Select Search > Go To.
  2. Change the select box to Pending Changelist.
  3. Type in the shelved changelist number and click OK.
  4. Select the files in the Shelved Files area.
  5. Right-click and select Unshelve.
  6. Click Unshelve.

For a committed changelist:

  1. Select Search > Go To.
  2. Change the select box to Submitted Changelist.
  3. Type in the submitted changelist number and click OK.
  4. Select the files in the Files area.
  5. Right-click and select Get this Revision.
  6. Click Close.

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.

Git-Fusion logo identifier image

In the following example, the current local task branch is task1, the target branch is main, the review id is 773273, the Git Fusion hostname is gfserver, and the remote repo name is p4gf_repo.

  1. Fetch the review's head version:

    $ git fetch --prune origin
    From gfserver:p4gf_repo
    * [new_branch]      review/main/773273 -> origin/review/main/773273
    x [deleted]         (none)     -> origin/review/dev/new

    The --prune option lets the local Git repo delete the unwanted review/main/new reference created by the initial git push origin task1:review/main/new command.

  2. Check out the review's head version:

    $ git checkout review/main/773273
Important

You can only update Git Fusion-initiated reviews using Git Fusion.

For more information on Git Fusion, see the Git Fusion Guide.

Download files as a ZIP archive

The Download .zip button is used to download a ZIP archive that contains all of the files in the review. The version of the files downloaded is the most recent review revision selected in the review revision selector, see Select review revisions to view.

Note

The Download .zip button is not displayed if the zip command-line tool is not installed on the Swarm server. For information about installing, and configuring the zip command-line tool, see Zip archive.

When you click the Download .zip button, Swarm performs the following steps:

  1. Scans the files/folders:
    • Checks that you have permission to access their contents, according to the Helix Core server protections.
    • Checks that the total file size is small enough to be processed by Swarm.
  2. Syncs the file contents to the Swarm server from the Helix Core server.
  3. Creates the ZIP archive by compressing the file content.
  4. Starts a download of the generated ZIP archive.
Note
  • You might not see all of the above steps; Swarm caches the resulting ZIP archives so that repeated requests to the same files/folders can skip the sync and compress steps whenever possible.
  • If an error occurs while scanning, syncing, or compressing, Swarm indicates the error.