Unapprove modified reviews

By default, P4 Code Review changes an approved review to Needs Review when a commit or update modifies files in the review after approval.

For files with the +k (ktext) filetype, this can cause false positives because P4 Server expands RCS keywords when the file is submitted, making the file appear to have changed even when the content is unchanged.

To prevent this, P4 Code Review compares file content using MD5 digests. For +k (ktext) files, the server calculates digests from content retrieved with p4 print -k, which removes RCS keyword expansion before comparison. As a result, P4 Code Review ignores changes where the only difference is an expanded RCS keyword value.

Set unapprove_modified to true in depots that contain ktext files.

Setting unapprove_modified to false disables automatic unapproval for all file changes, not just changes to ktext files. If you previously disabled unapprove_modified to avoid false positives caused by ktext files, you can safely re-enable it.

A configuration change only takes effect when the configuration cache has been reloaded. You must be an admin or super user to reload the P4 Code Review config cache.

To reload the configuration:

  1. Open the user menu (top-right corner of P4 Code Review).

  2. Select System Information.

  3. Open the Cache Info tab.

  4. Click Reload Configuration.

If changes to the config.php file might have caused the P4 Code Review web interface to become unresponsive, remove the problematic changes from the config.php file, then clear the configuration cache by running this command: rm -f /opt/perforce/swarm/data/cache/module-config-cache.php

To disable this behavior, edit the SWARM_ROOT/data/config.php file, and add or update the unapprove_modified item to false, within the reviews configuration block. For example:

<?php
// this block should be a peer of 'p4'
'reviews' => array(
'unapprove_modified' => false,
),

For information on file types, see File Types in P4 CLI Reference.