Question

I am doing this

p4 edit <list of files>
p4 revert -a
p4 submit -d "automation"

Now if there is no change in the default changelist the p4 submit option fails. How do I submit only when there is some files in default changelist

Was it helpful?

Solution

Before you run your submit, run p4 opened and see if it returns any results (e.g., pipe it to wc -l, say). If it does, do the submit; if it does not, skip the submit.

OTHER TIPS

Thanks to Mark I got this working.Adding it below so that others can benefit

@echo off
p4 opened   2>&1  | findstr /I /C:"File(s) not opened on this client."  1>nul
if %errorlevel% == 0 (
echo "Nothing to submit"
) else (
p4 submit -d "automation submitting XXXX"
) 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top