Perforce Public Knowledge Base - Problems deleting shelf with pending resolves
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Problems deleting shelf with pending resolves

« Go Back


When I attempt to delete a shelf, I get the following error message:
$ p4 shelve -d -c 12109
//depot/www/dev/index.html - unshelved file for bruno@b_client needs resolve
Shelve aborted -- fix problems then use 'p4 shelve -c 12109'.

What does this message mean and how do I resolve it?

When you unshelve a changelist into a client with opened files it can generate a situation where a resolve is needed. For example, user tim shelved a change to the file '//depot/www/dev/index.html':

$ p4 -ztag describe -s 12109
... change 12109
... user tim
... client test
... time 1423589177
... desc test
... status pending
... changeType public
... shelved 
... IsPromoted 1
... depotFile0 //depot/www/dev/index.html
... action0 edit
... type0 text
... rev0 3

User bruno now unshelves that change into his client that already has the same file opened for edit:
$ p4 unshelve -s 12109
//depot/www/dev/index.html#3 - unshelved, opened for edit
... //depot/www/dev/index.html - must resolve //depot/www/dev/index.html@=12109 before submitting
... //depot/www/dev/index.html - also opened by tim@test

We see the resolve is noted and since the resolve depends on the content of shelved change 12109 the Perforce Server will prevent it from being deleted:
$ p4 shelve -d -c 12109
//depot/www/dev/index.html - unshelved file for bruno@b_client needs resolve
Shelve aborted -- fix problems then use 'p4 shelve -c 12109'.

until the resolve is completed or the opened file reverted. 

How do I fix this problem?

1) Have the user with the pending resolve either complete the resolve or revert the opened file. 

2) With a 2014.2 and later Perforce Server, a Perforce user with 'super' or 'admin' privileges can delete the shelf using the '-f' flag to the p4 shelve command:
$ p4 shelve -f -d -c 12109
Shelved change 12109 deleted.

Note, this will leave the user with the opened file only resolve options that don't involve the now deleted shelf content:
$ p4 resolve ...
//b_client/www/dev/index.html - their revision is unavailable; resolve -ay (ignore) or revert?
//depot/www/dev/index.html@=12109: can't resolve (shelved change was deleted); must revert, or revert -k and edit before submit.

3) With a Perforce Server version prior to 2014.2, as a Perforce user with super privileges, revert the opened file that's preventing the shelf from being deleted by running:
p4 login <USER>
p4 -u <USER> -c <CLIENT> -H <HOST> revert -k <FILE>

where <USER> is the Perforce user that owns the opened file needing resolve, <CLIENT> is the client workspace the file is opened in, <HOST> is the host field from that client workspace, and <FILE> is the depot path of the file needing reverting. For example, user bruno has an opened file with a pending resolve against shelved change 12109:
$ p4 opened -u bruno | grep index.html
//depot/www/dev/index.html#3 - edit default change (text) by bruno@b_client

A Perforce super user can run the following to revert the opened file:
​$ p4 client -o b_client | grep ^Host

$ p4 login bruno
User bruno logged in.

$ p4 -u bruno -c b_client -H revert -k "//depot/www/dev/index.html"
//depot/www/dev/index.html#3 - was edit, cleared
Related Links



Was this article helpful?



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

Characters Remaining: 255