Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You'll want to write a change-content trigger. These triggers are run after files are transferred to the server, but before they are committed to the DB. As per the perforce documentation, you can use a command similar to the following</p> <pre><code>p4 diff //depot/path/...@=&lt;change&gt; </code></pre> <p>In the change-content trigger the @= (where change is the changelist number sent to the trigger) will get you the contents of the files that were submitted. If you are looking for a way to check against the server version, you might be able to do something like</p> <pre><code>p4 diff -sr //...@=&lt;change&gt; </code></pre> <p>The -sr command will report on files that open and are the same as the current depot contents. Since the files haven't been committed yet, I'm going to assume that you will actually get a list of files whose contents that have been transferred to the server are the same as the current head revision in the depot. If p4 diff -sr returns any files that are the same, return a non-zero exit code and the submit will be halted and the user will have to revert his unchanged files manually.</p> <p>I don't think that you want to actually modify the contents of the changelist by doing the revert for him. That sounds too dangerous.</p> <p>Note that you can write your trigger in any language that makes sense (as a previous poster suggested). I do think that this kind of trigger is going to be pretty heavyweight though. You will essentially be enforcing a diff on all contents submitted for all users in order to make one developer step in line. Maybe that's an okay price to pay, but depending on the number of users and the sizes of their changelist (and files), this kind of trigger might take a long time to run.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload