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?
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.
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.
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.
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.
Why it's only 11 clicks in P4V, through an arbitrary sequence of menu items.
Let's send Perforce to usability school.
Here's a scriptable procedure for deleting a Perforce client. Use with care: this deletes all your work in progress on the client!
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.
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.
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
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.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With