NetBeans 6 Local History

As I was preparing to deliver a session on "New & Cool" for NetBeans 6, I realized I didn't really understand the benefits of a new feature called "Local History" so I did some investigation.  What is the real value of Local History over undo/redo?  Yes the visual differences window show below is nice.  But was is the real advantage?

Local History Diff


If you delete a chunk of code, you can restore it by reverting in local history.  I can easily do that with the undo.  I tested saving, deleting code, saving, then adding code and saving.  I expected local history to allow me to selectively undo the deleting code action while keeping my adding code action.  No dice.  Going back to a point in time adds back the deleted code but removes the added code.  

Answer

Local History is for entire file snapshots in time.  Think of it as a local SCM.  You can revert to a snapshot of a file at a certain time.  When is this useful?  Say you are coding away when you suddenly realize that you've followed an incorrect line of thinking.  You'd like to go back to where you were two days prior.  Well Undo is not going to get you there.  Local History saves the day!  Another Huge advantage of Local History is the "Revert Deleted".  Let's say you are doing some refactoring and you move major pieces of code out of a class and decide you can altogether delete the class from the project.  Then you realized that you forgot to move some critical code before deleting.  You can use Local History->Revert Deleted to restore every file you deleted in the project.  Again Local History has saved your bacon. :)

You can configure the number of days Local History holds on to versions of your files in the "Options-> Miscellaneous-> Versioning-> Local History" option.

Local History config
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

David Botterill

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today