Reputation: 13
I have a PowerShell script for nightly tests which look something like:
# Check out the result file
p4 edit result.txt
# Run tests (which write into results.txt)
RunTests
# Submit results (but only if changed from last test run)
p4 submit -f revertunchanged -d "Results from nightly tests" results.txt
This works great, except from every time results.txt is unchanged. At those times an empty changelist is left after the script is finished.
Is there any way to avoid this empty changelist?
Upvotes: 1
Views: 284
Reputation: 16389
The empty changelist is no big deal; you can just delete it if you want.
But, you might instead change your script slightly: just before you do the submit, do 'p4 revert -a results.txt'. That will revert results.txt, but only if it is unchanged.
Only run the 'p4 submit' if the 'revert -a' did not revert result.txt, because that means you have actual changes in it. (Another way to check this is to run 'p4 opened results.txt' to see if 'revert -a' left it open or not.)
Upvotes: 1