Skip to main content

FAQ Where is the eclipse workspace local history stored

FAQ Where is the workspace local history stored?
Every time you modify a file in Eclipse, a copy of the old contents is kept in the local history. At any time, you can compare or replace a file with any older version from the history. Although this is no replacement for a real code repository, it can help you out when you change or delete a file by accident. Local history also has an advantage that it wasn’t really designed for: The history can also help you out when your workspace has a catastrophic problem or if you get disk errors that corrupt your workspace files. As a last resort, you can manually browse the local history folder to find copies of the files you lost, which is a bit like using Google’s cache to browse Web pages that no longer exist. Each file revision is stored in a separate file with a random file name inside the history folder. The path of the history folder inside your workspace is

.metadata/.plugins/org.eclipse.core.resources/.history/
You can use your operating system’s search tool to locate the files you are looking for. Although not the prettiest backup system, it sure beats starting over from scratch!

This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.
Here's a simple example. Lets assume that you lost your file on Jun 12

cd .metadata/.plugins/org.eclipse.core.resources/.history/
ls -al * | grep "Jun 22" | grep "r\-\-" | sort -k 6
-rw-r--r-- 1 myusername myusername 41318 Jun 22 11:06 30ec989295bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 865 Jun 22 12:40 b015c947a2bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 865 Jun 22 12:40 e090e72da2bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 865 Jun 22 12:41 00e4ff56a2bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 872 Jun 22 12:42 7098a672a2bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 26100 Jun 22 13:19 4076ddc9a7bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 26066 Jun 22 13:21 106bb9d3a7bc00111703c0e5cbee369d
-rw-r--r-- 1 myusername myusername 26066 Jun 22 13:21 b0895feca7bc00111703c0e5cbee369d
The above command lists all the files under the .history directory, pulls those out with the specified date, filters out those with the correct permission, then sorts them by the date and time that starts in column 6.

As you can kind of observe by the file sizes, there are three different files that were edited here. Say you want the one that is 872 bytes long, the one that has a name that starts with "7098a6".

Use the file name to get it's directory it's in. From there you can open up the file, and see if it's the one you want.

find . -name 7098a672a2bc00111703c0e5cbee369d
./ae/7098a672a2bc00111703c0e5cbee369d
There are many other ways to do this same thing. The important thing to note here is that your files are not lost.

Comments

Popular posts from this blog

Stretch a row if data overflows in jasper reports

It is very common that some columns of the report need to stretch to show all the content in that column. But  if you just specify the property " stretch with overflow' to that column(we called text field in jasper report world) , it will just stretch that column and won't change other columns, so the row could be ridiculous. Haven't find the solution from internet yet. So I just review the properties in iReport one by one and find two useful properties(the bold highlighted in example below) which resolve the problems.   example:
<band height="20" splitType="Stretch"> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement stretchType="RelativeToTallestObject" mode="Opaque" x="192" y="0" width="183" height="20"/> <box leftPadding="2"> <pen lineWidth="0.25"/> …

JasperReports - Configuration Reference

Live - solving the jasper report out of memory and high cpu usage problems

I still can not find the solution. So I summary all the things and tell my boss about it. If any one knows the solution, please let me know.


Symptom: 1.The JVM became Out of memory when creating big consumption report 2.Those JRTemplateElement-instances is still there occupied even if I logged out the system
Reason:         1. There is a large number of JRTemplateElement-instances cached in the memory 2.The clearobjects() method in ReportThread class has not been triggered when logging out
Action I tried:      About the Virtualizer: 1.Replacing the JRSwapFileVirtualizer with JRFileVirtualizer 2.Not use any FileVirtualizer for cache the report in the hard disk Result: The japserreport still creating the a large number of JRTemplateElement-instances in the memory     About the work around below,      I tried: item 3(in below work around list) – result: it helps to reduce  the size of the JRTemplateElement Object                Item 4,5 – result : it helps a lot to reduce the number of  JRTemplateE…