Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce: How can I delete a changelist that p4v refuses to delete?

Tags:

perforce

After a while of working with perforce I was left with a lot of still open change lists. To clean up I want to get rid of a subset of them. So here is what makes this complicate:

  • For a subset of the changes the host of the client has changed.
  • Some changes contain shelved files.
  • Files from the change list may be deleted or moved.

When one or more of above points are true for a change list, p4v (the visual client) will not allow you to delete the change list.

So what is an effective way of deleting these change lists?

like image 656
Pascal Avatar asked Feb 12 '23 10:02

Pascal


1 Answers

First of all, perforce refuses to work on any change lists if the host differs in their workspace. So step one is to change the host of the workspace to the current one. This can easily be done with the visual client p4v. Open the properties of a workspace, choose edit and change the host.

Then you can use the command line to get rid of the pesky change list(s):

# to delete a changelist
CLIENT="name_of_your_client"
CHANGE="number_of_the_changelist_to_delete"
p4 -c $CLIENT shelve -c $CHANGE -d //... # Delete all shelved files from it.
p4 -c $CLIENT revert -k -c $CHANGE //... # Revert all files from changelist (only metadata).
p4 -c $CLIENT change -d $CHANGE # Finally delete the changelist.

After the last command the change list will be gone forever.

like image 63
Pascal Avatar answered Feb 15 '23 01:02

Pascal