I would like to know if there’s a built-in function in P4 or a way to basically only allow the p4 submit to commit ONLY when the file has a diff. Let said I have rev 1, and I want to update the file with rev 2. But I should be only allow to make this change if rev 2 is actually diff from rev 1.
I checked P4 Manual on “p4 submit” , but I don’t see much about this type of scenarios. The P4V GUI has one of these options, but how do we get this accomplish in command-line? Thanks.
p4 submit -d "Update new drop $now" file.txt
There are a few options.
-f revertunchangedor-f leaveunchangedoptions on thep4 submitcommand (p4 help submit).p4 revert -acommand before submitting (p4 help revert)SubmitOptionson your client (a.k.a your workspace) so that it will always revert unchanged files before submitting (p4 help client).P4V can be considered a wrapper of the
p4command line, i.e. it performs the exact same commands.Tips:
If you want to see what you commands P4V is performing, go to your preferences and change the log settings to output more detail.
Did you notice the way I formatted the help links? If you type that (e.g.
p4 help submit) into your command prompt / terminal, it will display the help for that command. If you want to see what other commands are available typep4 help commands.