« Return to Thread: Want to see the contents of all versions of a file.

Re: Want to see the contents of all versions of a file.

by Alexander Sinyushkin :: Rate this Message:

Reply to Author | View in Thread

Hello Amaresh,

As a simple solution for your task I would advise you
to use SVNRepository.getFile().

You initialize the library first for the protocol
you're going to use to access a repository. For simplicity, suppose
we'll need only http:// access:

DAVRepositoryFactory.setup();

The same way for file://

FSRepositoryFactory.setup();

and for svn://

SVNRepositoryFactoryImpl.setup();

Then you create an SVNRepository object:

SVNRepostory repos =
SVNRepositoryFactory.create(SVNURL.parseEncoded("http://host/repos/root"));

Then you fetch file contents, say, from revision 6:

SVNProperties filePropsInRev6 = new SVNProperties();
repos.getFile("/path/to/file", 6, filePropsInRev6, System.out);

That's it.
----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

amareshghosh wrote:

> Hi,
>
> My name is Amaresh.I  am doing my thesis on subversion. I need. little bit
> help.Assume that, I have a file. And that file has 7 versions. I want see
> the contents of all 7 versions of that file. Means if I want to see the 2nd
> version content of this file it should give the content of 2nd version of
> that file. if I want to see the content of the file when it was in 6th
> version, it should give the content of that file 6th version. I am hoping
> that i will get quick reply. Thank you very much
>
> Best Regards,
> Amaresh Ghosh

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...

 « Return to Thread: Want to see the contents of all versions of a file.