[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: Mathias Weinert <mathias.weinert_at_gfa-net.de>
Date: 2005-10-18 08:50:36 CEST

Philip Martin <philip@codematters.co.uk> wrote:

> "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.?

Yes, that's what I mean (although I have to agree to Daniel that it is more
of a unified diff than a context diff).

> > 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.

I already had a look at SVK but at the first sight I didn't find what I
am looking for. Anyway thanks for that hint.

> > 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'.

So let's change my question to this:
Is there any function available via the Perl bindings which allows to directly
apply a unified diff (produced by 'svn diff') to a path in the repository?

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 18 08:51:31 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.