[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Reading and applying a diff file with Perl bindings

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-10-17 19:20:32 CEST

"Mathias Weinert" <mathias.weinert@gfa-net.de> writes:

> I have a file that was produced by 'svn diff' which I want to apply to

Do you mean a context diff with lines staring '+', '-', etc.?

> a file in my repository by using subversion's perl bindings. I am
> using SVN::Simple::Edit as with this it is very easy to change files

Do you mean the CPAN module? That's not part of Subversion, and it's
an interface to Subversion's delta editor so it's not really
appropriate for applying a context diff.

Perhaps you should look at svk (svk.elixus.org) as it's written by the
person who wrote SVN::Simple::Edit.

> in the repository with only few lines of code. Unfortunately
> SVN::Simple::Edit only provides a function which gets the complete new
> content of a file (modify_file()) but not only the differences.
>
> Is there an easy way to do what I want?
>
> I think it should be able by using SVN::TxDelta::send_txstream()
> instead of SVN::TxDelta::send_stream() which is used by modify_file()
> but the only way I found to create a txstream is by calling
> SVN::TxDelta::new() which needs source and target again.

The txdelta format is totally different from that of the context diff
produced by 'svn diff'.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 17 19:21:24 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.