Questions related to svnkit

View: New views
3 Messages — Rating Filter:   Alert me  

Questions related to svnkit

by Komal Goyal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am having few questions related to using svnkit in my application

1) can patch sets be applied to the svn repository from a web application ? (like users has a patch file and need to apply to a existing file in a repository)
2)how can I get the contents of a file from a repository with like nos ?
3) Is it possible to add comments to a file in the repository any time other than while commiting?

Please let me know if it is possible with svn kit or some other api is available to do so.

Thanks,
Komal

Re: Questions related to svnkit

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Komal,

> 1) can patch sets be applied to the svn repository from a web
application ?
> (like users has a patch file and need to apply to a existing file in a
> repository)
In general yes, it is possible. However, to modify a file in repository
you need full contents of a target file contents, which is not included
into the patch (except for added files). So, what you'll most probably
will have to do is to get existing files contents, apply patch to those
files and then commit new versions.

You may do that with the working copy (so first you'll have to check out
files, then apply patch, then commit) or with SVNRepository API - then
you may just get files contents with SVNRepository.getFile, apply patch
and then commit with the help of ISVNEditor.

To apply patch in GNU format you'll need to use some third-party tool,
SVNKit couldn't do that.

> 2)how can I get the contents of a file from a repository with like nos ?
To get file contents use SVNRepository.getFile(...). Line numbers of
course will not be added - this you will have to do in your code (note
that files might have different line breaks or be binary).

> 3) Is it possible to add comments to a file in the repository any time
other
> than while commiting?
Yes, it is possible - you may change svn:log revision property for
certain revision at any time. Prerevpropchange hook should be enabled in
repository though.

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

Komal Goyal wrote:

> Hi,
>
> I am having few questions related to using svnkit in my application
>
> 1) can patch sets be applied to the svn repository from a web application ?
> (like users has a patch file and need to apply to a existing file in a
> repository)
> 2)how can I get the contents of a file from a repository with like nos ?
> 3) Is it possible to add comments to a file in the repository any time other
> than while commiting?
>
> Please let me know if it is possible with svn kit or some other api is
> available to do so.
>
> Thanks,
> Komal

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


Re: Questions related to svnkit

by Komal Goyal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HiĀ Alexander,

thanks for the prompt response. :)


>you may just get files contents with SVNRepository.getFile, apply patch
and then commit with the help of ISVNEditor.

Here you have said to get the contents and apply patch here is where I am not clear what I have to do
Can you give me some hints for this?

To apply patch in GNU format you'll need to use some third-party tool,
SVNKit couldn't do that.

Regarding this does it mean I have to apply patches in GNU formats or it is just a special case?

Regards,
Komal