Reputation: 487
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?
Upvotes: 45
Views: 103521
Reputation: 9591
All the files need to be reverted before the change list can be deleted.
Two steps via p4v (version 2013.4):
Revert all files.
Right click the pending changelist, and then choose "Revert Files"
Delete the change list.
Right click the changelist, and then choose "Delete Pending Changelist 'XXXXXX'"
Upvotes: 3
Reputation: 3860
Wrote this script called p4-delete-client for deleting a p4 client (which has changelists & other problems).
It has the following features:
Note that the script relies on other scripts in the repo.
Upvotes: 5
Reputation: 65854
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.)
Upvotes: 21
Reputation: 1371
This just worked for me in P4V for resetting the default changelist:
Right click on the default changelist and choose "Edit Pending Changelist 'default'"
Click the button on the bottom right "Save as numbered changelist"
Right click on the new changelist and choose "Delete changelist XXX"
You can also right click on the new changelist to revert the files for whatever you need to do, which is not available as an option on the default changelist.
Upvotes: 0
Reputation: 399
try those steps :
1.Right click on the changelist
Choose 'Change Ownership'
In the workspace box choose already existing workspace and click OK
Upvotes: 2
Reputation: 137524
Why it's only 11 clicks in P4V, through an arbitrary sequence of menu items.
Let's send Perforce to usability school.
Upvotes: 49
Reputation: 10824
Here is what I did to empty my default change set, which had a lot of files checked out for edit:
p4 opened | sed 's/#.*$//g' | xargs -iF p4 revert F
This will cut off the comment part from the filename produced by p4 opened
and pipe the filename to p4 revert
. After that I had nothing pending and p4 changes -c my-client-name -s pending
yields nothing. If you have a huge change set this will take a while.
Upvotes: 10
Reputation: 16339
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.
Upvotes: 57