I quickly shelved a changelist and went to bring it back, but there was no shelve to unshelve from

I had a meeting starting, and needed my code to be compilable to run some apps that I knew would come up in the meeting.  I was in the middle of working on some code in a changelist, and thus the codebase wouldn't compile.  So I clickly shelved the changes, which reverted the file I was editing, and was then able to compile.  After the meeting I went to find the shelve to unshelve my code, and there was no shelf for today.  I lost a good amount of code I rather not re-write.  Can anyone help me get it back.

BTW, I did notice that when I shelved the code, I got that message that my project had changed externally and I needed to re-read the project.  I am wondering if the shelve data is kept in the .iws, and if somehow idea changing the .iws was perceived as being done externally, and if by re-reading the project I somehow lost the shelve.

Anyone know how to recover this?

[IDEA 10.5 build IU-107.105]

....
Just found some more information.  In ~/Library/Preferences/IntelliJIdea10/shelf, I found a patch, which is the patch to my code.

So, now...

1.) Why did this not show up as a shelf.  Is all I need to do maybe is restart IDEA (I will try)

2.) If I can't figure out how to make this a shelf again, can I apply this patch on the command line somehow (Mac OS X).

Tx.

Message was edited by: Eric Bergerson

1
4 comments

Okay, although I still don't know why I lost my shelf, I thought I found a fix.  I found both the "Import Patch" option
on the shelve tab of the Changes tool.  Also the "Apply Patch" option from the Version Control menu
.  My plan was to take the patch I found and import and apply it.  When using either approach, a model file chooser pane
l drops down, assumedly to let you select the patch file.  Unfortunately, at that point IDEA locks up and becomes un-responsive.  I tried both approaches mutlitple times, having to forcefully kill IDEA each time.

So, now I need another way to apply the patch.

0

Ok, I have saved myself, and maybe also answered the question of why IDEA failed.

I copied the reverted src file to a new directory.
I copied the discovered patch file to the new directory.

I found and read the doc on the 'patch' program and applied it (--dry-run).

I found that the one file I thought was shelved was not the only file.

My All.iws file was also in the patch.

I keep my project files in svn, which some may say doesn't make sense.  But I have too many configurations to risk losing them.  I don't minde committing my iws to svn all the time.

However, that may be where the shelving bug lies.  That is surely why I was told that my project files were changed externally.  The iws file was not changed externally, it was reverted by IDEA as part of the patch.

So, in the future I will have to be careful to exclude the iws file from code being shelved.  It would be nice if this could be fixed, so it doesn't blow up in my face if I forget.

I was able to restore my changes by hand and replace the reverted file with the patch restored version.

0

Ok, too funny (or really sad, depending on how you look at it).  I just tried to shelve code and lost the shelf.  Looked on the internet to see what I did wrong and found my own posts, to which I am no replying.  It appears that my request at the end of my last post, to please have this fixed before I do it again because I will forget my own warning, was well anticipated.  I did indeed just do it again.

So, what do you say, can this get fixed?

0

Project files DO belong in the VCS. The workspace file (*.iws or .idea/workspace.xml) does not though, as it constantly changes and just saves the workspace like opened windows, opened files etc. Especially when you collaborate with others, the workspace file does not belong to VCS. If you don't want to loose your configurations, make them shared ones, then they are in the .ipr file or in an own file each in .idea/runConfigurations/ which all belongs in the VCS.

0

Please sign in to leave a comment.