Pending Changelists

I see a bunch of pending p4 changelists in the repository, how do I clean those up?

To list the pending changelists use:

Unix> p4 changes -s pending
        

To delete the empty pending changelists

Unix> p4 changes -s pending | awk '{print $2}' | xargs p4 change -d -f

or

Unix> for change in `p4 changes | grep pending | cut -f2 -d' '`; do p4 change -d $change; done
        

To delete a non-empty pending changelist:

From the workspace the changelist belongs to:

  1. Edit the changelist: p4 change <changenum>
    1. Remove the files from the changelist and save
  2. Delete the changelist: p4 change -d <changenum>