Files configuration
P4 Code Review can be customized using the following config items:
You must be an admin or super user to reload the P4 Code Review config cache. Navigate to the User id dropdown menu, select System Information, click the Cache Info tab, and click the Reload Configuration button.
max_size
P4 Code Review limits the size of files displayed in both reviews and standard file views. Add or deleted files larger than 100 KB are paginated. The pagination limit cannot be changed.
max_size
configuration behaves. For P4 Code Review 2025.2 and earlier, see File configuration.
How the files are paginated depends on the type of review being displayed.
-
When viewing added or deleted files, the entire file is treated as a single diff, with large files paginated according to the 100 KB limit. The
max_size
does not affect pagination.
-
When viewing edited files,
max_size
is still relevant but works differently alongside pagination. This is because diffs can be small even though they are in a large file.-
Diff size over limit: If a diff exceeds 500 lines, it is paginated. The 500 line limit cannot be changed. The
max_size
configuration is not used for truncating diffs. -
Full file size over limit: The
max_size
configuration is used to limit the display of edited files with large file sizes. If the file is larger than themax_size
value:-
The buttons to show more lines are disabled.
-
The Show full context button is disabled.
-
When using the API, the
fetchContent
response flag is set to false.
-
-
Within file size limit: If the file size is within the limit defined by
max_size
, these buttons are enabled andfetchContent
is true.
-
isCut
is now obsolete.Known limitations with pagination
Truncated diffs may hide unchanged lines and additional diffs
When viewing the changes of a large file that has been truncated, if a diff with more than 500 lines is followed by fewer than 10 unchanged lines along with another diff, only the first (truncated) diff is shown initially. The 10 unchanged lines and the second diff are hidden until the first diff is fully expanded using the Show next button.
Workaround: Reviewers should fully expand any truncated diffs to ensure all subsequent changes and unchanged lines are visible.
Comment links may fail to navigate to truncated diff sections
Clicking a comment from the Comments tab does not navigate you to its location in the Files tab if the comment was made in a section of the diff that has been truncated. The comment remains hidden until the diff is manually expanded.
Workaround: If you do not see the in-line comment, click Show next to expand the truncated diff manually in the Files tab to view the comment in context.
Complexity column displays incorrect line count for large added or deleted files
When a review includes added or deleted files with a large number of lines, the Complexity column on the Review page may display an incorrect line count. Instead of showing the full number of lines in the file (for example, 10,000), it reflects only the number of lines in the first truncated diff chunk (this is usually 3,800). This issue does not affect edited files.
In summary:
When viewing a large file that has been added or deleted, the file contents are paginated with a fixed 100 KB system limit.
When viewing an edited file:
-
The file diffs are controlled by a fixed 500 line limit.
-
The file size is controlled by the configurable
max_size
value.
Below is an example of the max_size
configurable.
<?php
// this block should be a peer of 'p4'
'files' => array(
'max_size' => 1000 * 1024, //1MB (in bytes)
),
download_timeout
When downloading files, there is a timeout which defaults to 30 minutes. This can be changed by setting the download_timeout
configurable to a value in seconds. Alternatively, setting it to zero removes the timeout.
<?php
// this block should be a peer of 'p4'
'files' => array(
'download_timeout' => 1800, // seconds (30 minutes)
),
allow_edits
By default, you can edit a file from the files page and shelve or commit it.
When set to false, files cannot be edited from the P4 Code Review files page.
<?php
// this block should be a peer of 'p4'
'files' => array(
'allow_edits' => false, // default is true
),