Perforce Public Knowledge Base - Deleting a changelist with an empty shelve
Perforce Software logo
Reset Search
 

 

Article

Deleting a changelist with an empty shelve

« Go Back

Information

 
Problem
Due to some database inconsistency issues, some changelists may be associated with an empty shelve that cannot be deleted. You may attempt the following procedure to delete such problematic changelists.
Solution
The basic idea to shelve a file to the changelist so that the shelve will no longer be empty which then allow the changelist and shelve to be deleted. This example illustrates how do this can be done as an Perforce Administrator on behalf of the user of the problem changelist. The user can also do this but without the need for user impersonation and adding AltRoot to the client, that is, Steps 3, 4 , 12 and 13.

1.  Changelist contains an empty shelve

$ p4 -p server:1666 describe -sS 1234

Change 1234 unknown.
Change 1234 by bruno@bruno on 2015/07/01 07:10:10 *pending*
Unremovable changelist
Shelved files ...

2. Unable to delete the Changelist

$ p4 -p server:1666 change -d -f 1234
Change 1234 has shelved files associated with it and can't be deleted.
 
3. Login as the Changelist owner

$ p4 -p server:1666 login bruno
User bruno logged in.

4. Add a valid local path as AltRoot to the client

$ p4 -p servert:1666 -u bruno_ws  -H bruno_p4host client
Client bruno_ws saved.

5.  Sync a sync to the workspace

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host sync -f //depot/to/some-file.txt
//depot/to/some-file.txt#1 - added as /Users/bruno/depot/to/some-file.txt

6. Open the file in the Changelist

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host open -c 1234 //depot/to/some-file.txt
//depot/to/some-file.txt#1 - opened for edit
 
7. Shelve the file in the Changelist

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host shelve -c 1234

Shelving files for change 1234.
edit //depot/to/some-file.txt#1
Change 1234 files shelved.

9.  Delete the non-empty Shelf

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host shelve -d -c 1234
Shelved change 1234 deleted.

10. Revert the opened file

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host revert -c 1234 //depot/to/some-file.txt
//depot/to/some-file.txt#1 - was edit, reverted

11. Delete the Changelist

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host change -d 1234
Change 1234 deleted.

12. Remove the local valid path from AltRoot

$ p4 -p server:1666 -u bruno -c bruno_ws -H bruno_p4host client
Client bruno_ws saved.

13.  Log out from the user

$ p4 -p server:1666 -u bruno logout
User bruno logged out.
 
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255