Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 API for Go Documentation | 2025.1

# P4Revision struct

## Description

The `P4Revision` struct provides a utility for accessing and managing the revisions of a file in a P4 Server depot. Each `P4Revision` instance stores detailed information about a specific revision of a file, including metadata such as the revision number, change number, action, type, user, and client. Additionally, it maintains a list of integration records (`P4Integration` structs) associated with the revision. These objects are typically created by the `RunFilelog` method.

## Table of methods

This struct returns the attributes of revisions to the `P4DepotFile` struct. Use `the RunFilelog()` method to get the revision attributes.

Method | Type | Description
--- | --- | ---
`Action` | String | Action that created the revision. The name of the action (e.g., "edit", "add", "delete") that created this revision.
`Change` | Int | The changelist number that gave rise to this revision of the file.
`Client` | String | The name of the client workspace from which this revision was submitted.
`Desc` | String | The description of the change that created this revision. Note that the length of the description may vary depending on the `p4 filelog` options used.
`Digest` | String | The MD5 digest for this revision of the file.
`Filesize` | String | Returns the file size of this revision.
`Integrations` | `P4Integration` | Slice of `P4Integration` structs representing the integration records for this revision.
`Rev` | Int | Revision number.
`Time` | Time | The date and time when this revision was created.
`Type` | String | The P4 Server filetype of this revision (e.g., "text", "binary").
`User` | String | The name of the user who created this revision.

## Example

### `AddIntegration(how string, file string, srev int, erev int)`

Adds an integration record to the revision. This method appends a new `P4Integration` instance to the `Integrations` slice.

Your search for returned results