Personal Revision Control System


Index · 
Overview · 
Design · 
Using · 
Faq · 
Download · 
Developers · 
 

Overview

Any Revision controller system consists of 4 parts

1) Finding the difference
2) Storing the difference
3) Retrieving the difference
4) Getting the desired version

Finding the difference

For finding the differences we have not done any hard work. We are using JLibDiff which gives the difference between two files.These two files can be same file ( different version) or alltogether two different files.For studying more about JLibDiff you can visit JLibDiff HomePage.JlibDiff is basically a library which gives difference between two files in form of Java Objects.If you want to understand how JLibDiff interprets the difference and what results it gives when two files are given as input you can take a look here After reading it wont be difficult for you to understand the fact that the 3 different objects provided by JLibDiff are HunkDelete , HunkChange and HunkAdd which correspond to deletion , change and addtion in second file relative to first file.

Storing the difference

Next we come to the problem of saving the difference objects persistantly . Storing the difference is made easy by java "serialization" technique.Here we serialize the java objects provided by JLibDiff and save it using standard java serialization.We store this differnece in files in users machine.Right now we are not using any database.But suggestions about using any Object DataBase (Hibernate ???) are welcome.

Retrieving the difference

Every thing which is stored has to be retrived.Well! I mean ofcourse when required so ,when we require the difference object we can use standard java apis for reading objects from file .After reading the objects this can be casted back into their original format (Hunks).

Getting the desired version

Getting the desired version has some logic behind it. To understand this you have to be thorough in the JLibDiff concepts and how it interprets the difference between two files.If you have still not read that we strongly suggest you read it .it can be found here. After reading this you will understand that we just do reverse mapping of the difference between the two versions. Basically we always store the first version of the file , when users provides the version number and asks for file corresponding to that version , we do reverse mapping of the difference (which we had stored earlier )with the first version and provide the desired file.

Back to Top