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.
How to handle p4 submit if no open files in command line
-
30-06-2023 - |
Вопрос
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
Решение
Другие советы
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"
)
Не связан с StackOverflow