Attempting to submit a changelist with no files is considered by Perforce to be an error (p4 submit ...
returns exit code 1). This causes a periodic integration build to fail on our build server (we're using Zutubi's Pulse system); in this case I would rather have the build succeed, possibly with a warning.
Pulse has exit code remapping functionality, but Perforce does not appear to disambiguate between a failure to submit an empty changelist and any other submit failure (such a validation trigger failure, which I do want to fail the build).
The immediately obvious (but, in my mind, inelegant) solution that comes to mind is to wrap execution of p4 submit
in a batch file that first checks to see if the target changelist is empty by counting lines of output from p4 opened
-- or just parsing the output of p4 submit
for the "no files" message and returning successfully from the batch file.
Are there better techniques for handling this that I'm not seeing?