Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 212111 - Local History Get Contents erases file contents
Summary: Local History Get Contents erases file contents
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-06 01:16 EST by Tejas Patel CLA
Modified: 2019-11-14 03:34 EST (History)
6 users (show)

See Also:


Attachments
Action which reproduces the error (115.10 KB, image/pjpeg)
2007-12-18 08:43 EST, Tejas Patel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tejas Patel CLA 2007-12-06 01:16:43 EST
Build ID: I20070621-1340

Steps To Reproduce:
1. Right Click on file and say Compare -> Local History
2. You should have some revisions available for this file.
3. Right click on latest revision time and say "Get Contents".
4. It asks for overwrite. Say Yes.
5. Now see the file content. It becomes empty.


More information:
Comment 1 Szymon Brandys CLA 2007-12-06 03:37:23 EST
I tried to reproduce the issue using your steps on 3.3 and 3.4M3. Both works fine.   Please try to reproduce it on one of those versions. If you can, we will be investigating further.
Comment 2 Tejas Patel CLA 2007-12-18 08:43:20 EST
Created attachment 85461 [details]
Action which reproduces the error

I am able to reproduce this using 3.3.1.1 and also using 3.4M3.
Comment 3 Tomasz Zarna CLA 2007-12-19 10:21:58 EST
I confirm it'a a bug - I'm able to reproduce in 3.4M4. However, I'm not sure whether it should belong to Compare or Resources. We'll take a look at it with Szymon (the Resources guy).
Comment 4 Martin Oberhuber CLA 2010-08-25 07:50:38 EDT
CQ:WIND00176791

We still see this in Eclipse 3.5.2
Comment 5 James Blackburn CLA 2011-02-28 18:24:06 EST
(In reply to comment #4)
> CQ:WIND00176791
> We still see this in Eclipse 3.5.2

This is likely because the most recent save of the file isn't actually in the local history(!).  As a result you can't getContents because it hasn't been stored yet...

See also: bug 338430 + bug 10589.
Comment 6 Helmut J. Haigermoser CLA 2011-07-26 10:38:43 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > CQ:WIND00176791
> > We still see this in Eclipse 3.5.2
> This is likely because the most recent save of the file isn't actually in the
> local history(!).  As a result you can't getContents because it hasn't been
> stored yet...
> See also: bug 338430 + bug 10589.

James, 
what's the plan for this bugzilla, it's in assigned state for quite some time now, any chance we can get this fixed?
Helmut
Comment 7 Szymon Brandys CLA 2011-07-27 07:56:07 EDT
We can simply reproduce it by opening a file and then choose 'Get Contents' in the history view. The editor will become empty. Moving to Team.

The quickest fix here would be to disable 'Get Contents' for the latest history entry. If we are looking for the fix for bug 338430, it is not that easy.
Comment 8 Helmut J. Haigermoser CLA 2011-07-27 08:05:45 EDT
(In reply to comment #7)
> We can simply reproduce it by opening a file and then choose 'Get Contents' in
> the history view. The editor will become empty. Moving to Team.
> 
> The quickest fix here would be to disable 'Get Contents' for the latest history
> entry. If we are looking for the fix for bug 338430, it is not that easy.

Thanks Szymon! :)
Hm, a quick fix like this would help to prevent data loss, so it's a good start. :)
Sounds like the reason for the entry being available as history item, but not being fully ready yet, lies in another bug(338430), so trying a two-pronged attack of the issue seems reasonable. 
Thanks for looking into this !:)
Helmut
Comment 9 Helmut J. Haigermoser CLA 2011-08-30 05:49:15 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > We can simply reproduce it by opening a file and then choose 'Get Contents' in
> > the history view. The editor will become empty. Moving to Team.
> > 
> > The quickest fix here would be to disable 'Get Contents' for the latest history
> > entry. If we are looking for the fix for bug 338430, it is not that easy.
> Thanks Szymon! :)
> Hm, a quick fix like this would help to prevent data loss, so it's a good
> start. :)
> Sounds like the reason for the entry being available as history item, but not
> being fully ready yet, lies in another bug(338430), so trying a two-pronged
> attack of the issue seems reasonable. 
> Thanks for looking into this !:)
> Helmut

any news on this one?
Thanks @ll :)
Helmut
Comment 10 Lars Vogel CLA 2019-11-14 03:34:48 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.