It seems that p4 unshelve -s changelist doesn't bring the new source files that are added in the shelved changelist. Two questions:
- Am I missing something?
- Any workaround?
Thanks.
On
p4 unshleve will open files for add if they existed in the changelist passed to -s.
There exists a case where added files specifically wouldn't be unshelved and that is when the files already exist and are writable. For such files, you should be seeing an error saying:
Can't clobber writable file /file/path
I used to run into this case when I do the following:
workspace1workspace2workspace2, including the files opened for add
workspace2 and stay there in a writable stateworkspace2
p4 unshelve here you should see the error mentioned abovep4 opened on workspace2 and not find the files that were opened for add
On
I faced the same issue but for my case it's because of I have file(s) opened for add locally. Target shelved CL that I want to unshelve also has that file(s) opened for added as well. So if I try to unshelve target shelved CL, it will shout out similar to the following error message.
//depot/dir/file.h - can't unshelve (already opened for add)
So I have to do the following
p4 revert <file(s)> - revert all files opened for add. This won't remove the file(s), it will still be there. It will show message like //depot/dir/file.h#none - was add, abandonedp4 unshelve -s <target-CL> - to unshelve target CL again, this time, there should be no error message. If you already unshelved previously but has error for those file(s) opened for added only, then you can do just p4 unshelve -s <target-CL> <file1> <file2> to unshelve only those file(s) opened for add only.Done, now you can continue working.
p4 unshelveshould faithfully open every file that was shelved, for its corresponding action — add, edit, integrate, or delete. The opened file will be opened at the same working revision, with the same resolves (either pending or completed), and the same content.To answer your two questions:
Do the added files show up in
p4 files @=SHELF? If not, they were never shelved in the first place. Go back and fix that.Do you get an error message from
p4 unshelvetelling you that these files can’t be unshelved? If so, fix that.Are the files already opened according to
p4 opened? If so, either they did get unshelved or that’s the reason they couldn’t be unshelved.