Question

Introduction:

Hello, basically what i need to do is to simulate historical management (in the terms of DB historical management) for a set of files, containing compilable and executable pieces of code.

Explanations:

In DB historical management an object consists of its states, which are determined by the dates of the actual modification. Then the object can be fetched at given date along with the information that is current for that given date. This is the behavior that I am trying to implement for the files that I am going to execute. Since the most natural way of persisting the project files is via a SVN product, It crossed my mind that it may be possible that such feature is already implemented in Subversion or other Version Control System. What i need is - by a given date and may be a request to the svn server, to receive the "right" version (according to the date) of the document that I am keeping track to.

The question:

Currently I am using Subversion and TortoiseSVN, but I am not familiar with the advanced featured and seek some help here. Can I retrieve a file version stored within my SVN from my java code?

Any help will be appreciated, Regards,

Editions:

Since it seems my abstract explanation wasn't understandable enough here I will give an example. Lets assume that I have a file test.tgf in my SVN. Let this file by an executable binary file and my machine knows how to execute .tgf files. In SVN I have 2 versions of that file - version 1 that contains a code that will print to the console "This is the first version of this piece of code" and version 2 that contains a code that will print to the console "This is the second version of this piece of code". Lets now assume that we have a GUI that contain only 2 widgets - a date input and a "calculate" button. When the user input a date and click on calculate the java code handling that event must check if the date is less than of equal to 01.01.2010 and if so, to execute the first version of test.tgf. Otherwise the code that will be executed is the second version of test.tgf. I hope its more clear not.

Milen

Conclusion:

Yes it is possible to simulate historical management (in term of DB historical management) with a SVN. Thanks Poul

Was it helpful?

Solution

What i need is - by a given date and may be a request to the svn server, to receive the "right" version (according to the date) of the document that I am keeping track to.

You can watch your revisions and the date they were made. You also can filter revisions by date in TortoiseSVN. So what's a problem?

From java you can use SVNKit with SVNRepository class that has methods: getDatedRevision(Date date) and getFile()/getDir(). Simple example of usage is here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top