質問

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

役に立ちましたか?

解決

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.

他のヒント

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"
) 
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top