Ever open a file you've been working on and spent the first few minutes just trying to remember what changes you made the night before? Or ever wish you could just undo the last few days' changes? In this installment of CFEclipse Features, we will take a look at a feature that allows you to do just that.
CFEclipse actually automatically stores the history of a file locally. To view this history, simply right click on the file on the Navigator panel, or right click on an open file, and select "Compare With". Then select the "Local History?" option. This will bring up the history window, as shown in figure 1.
Figure 1
You can select any moment in time and it will display the differences between that moment in history, and the current version of the file.
Want to replace the current version of the file with a previous version? Simply right click the file and select "Replace With" instead of "Compare With". Once again select the "Local History" option. You will see a window just like the comparison window, except there is not a "Replace" button.
Eclipse will only keep one week's worth of history by default. But you can increase that if you like. To do this, click "Window" > "Preferences". Then select "General" > "Workspace" > "Local History". There are a number of settings that determine how much history is stored and for how long, all of which can be increased.
Figure 2
This feature is a great complement to a source control system like CVS or Subversion, and more then once has saved me hours of work. In the next installment of CFEclipse Features, we will take a look at the scribble pad feature.