« Return to Thread: reverting a file commit

Re: reverting a file commit

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View in Thread

Hello,

Sorry for delay with the answer.

 > When using SVNKit's low level API, how can I revert a file to a previous
 > revision?
With low-level API, i.e. SVNRepository you may just get file contents at
certain revision (see SVNRepository.getFile(...) method). You may then
copy this contents over existing file in the working copy and then commit.

However, in case you have a working copy, the best way to rollback
certain transaction is to perform "reverse" merge and then commit. With
command line client command for reverse merge looks like:

svn merge -rN:N-1 URL wcPath

This command will "revert" changes that were made in revision N, you
working copy files will be modified accordingly and you will be able to
commit that "revert". In SVNKit you should use
SVNDiffClient.doMerger(...) method to perform merge.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

sud wrote:

> When using SVNKit's low level API, how can I revert a file to a previous
> revision?
>
> When using subversion command's I can do this via the svn merge command.
> But haven't been able to figure out a straight forward way to do this
> via the SVKit low level API.
>
> Thanks in advance for any help.
> -sud
>
> ------------------------------------------------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
> it now.
> <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
>  >

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

 « Return to Thread: reverting a file commit

LightInTheBox - Buy quality products at wholesale price