Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a perforce client with pending changelist

Tags:

perforce

I have a workspace in perforce in which I made some files mark for delete. Now I want to delete that workspace forcefully.

But I don't have admin rights. How can I achieve this?

like image 979
Steve Mark Avatar asked Sep 06 '12 08:09

Steve Mark


People also ask

How do I delete a shelved Changelist?

Using -d -c flag deletes the shelved files in the specified changelist so that they are no longer available for p4 unshelve operations. By default, only the user and client of the pending changelist can delete its shelved files.

What is a pending Changelist?

A pending changelist stores information about files you are working on. There are two kinds of pending changelists: the default changelist, and numbered pending changelists. Your workspace automatically has one default changelist. You can optionally create one or more numbered pending changelists in your workspace.

How do I delete a file from Changelist?

You can Ctrl+left-click multiple files, then right-click on one of them and select Move to another changelist... . You can also choose to Submit... the files, and when the dialog box appears, their will be checkboxes next to each file. Uncheck the files you do not want to submit.


3 Answers

Run p4 opened to see all your opened files and run p4 revert to revert them.

Then run p4 changes -c your-client-name -s pending to see all your pending changelists. Since in the first step you reverted all your open files, these changelists will all be empty. Run p4 change -d change-number to delete each empty pending changelist.

Then you can run p4 client -d to delete your client.

like image 91
Bryan Pendleton Avatar answered Sep 23 '22 16:09

Bryan Pendleton


Why it's only 11 clicks in P4V, through an arbitrary sequence of menu items.

  1. Right click on the changelist
  2. Delete shelved files
  3. 'Yes'
  4. Right click on the changelist
  5. Remove all jobs
  6. Right click on the changelist
  7. Revert files
  8. 'Revert'
  9. Right click on the changelist
  10. Delete pending changelist
  11. 'Yes'

Let's send Perforce to usability school.

like image 35
Colonel Panic Avatar answered Sep 22 '22 16:09

Colonel Panic


Here's a scriptable procedure for deleting a Perforce client. Use with care: this deletes all your work in progress on the client!

  1. Revert all changed files on this client.

    p4 -c $CLIENT revert -k //...
    

    Note the use of the -k option, which "marks the file as reverted in server metadata without altering files in the client workspace". Since we are going to delete the client later, we don't care about updating the client workspace. This speeds things up if you have many files open.

  2. Delete all shelved files from pending changes associated with the client.

    p4 changes -s shelved -c $CLIENT | cut -d' ' -f2 |
    while read CHANGE; do p4 shelve -c $CHANGE -d //...; done
    

    If you never use p4 shelve you can omit this step.

  3. All pending changes associated with the client are now empty. Delete them.

    p4 changes -s pending -c $CLIENT | cut -d' ' -f2 | p4 -b 1 -x - change -d
    
  4. There are now no pending changes associated with the client. Delete the client.

    p4 client -d $CLIENT
    

(This process ought to be much easier! In particular, there seems no good reason why we have to delete shelved files associated with a client before deleting the client. If you find yourself struggling with this, do contact Perforce support and suggest that it be made simpler.)

like image 37
Gareth Rees Avatar answered Sep 21 '22 16:09

Gareth Rees