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

Re: svn commit: r1034139 - in /subversion/trunk/subversion: libsvn_client/patch.c tests/cmdline/patch_tests.py

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 12 Nov 2010 03:14:13 +0200

Stefan Sperling wrote on Fri, Nov 12, 2010 at 01:07:53 +0100:
> On Thu, Nov 11, 2010 at 09:21:26PM -0000, dannas_at_apache.org wrote:
> > Author: dannas
> > Date: Thu Nov 11 21:21:16 2010
> > New Revision: 1034139
> >
> > URL: http://svn.apache.org/viewvc?rev=1034139&view=rev
> > Log:
> > Add support for handling symlinks in 'svn patch'.
>
> Nice :)
>
> If you haven't done so, can you close the corresponding issue, too?
> Thanks!
>

Issue #3697.

> One question below:
>
> > + if (target->is_special)
> > + {
> > + svn_stream_t *stream;
> > + svn_stream_t *patched_stream;
> > + apr_file_t *file;
> > +
> > + SVN_ERR(svn_io_file_open(&file, target->patched_path,
> > + APR_READ | APR_BINARY, APR_OS_DEFAULT,
> > + pool));
> > +
> > + patched_stream = svn_stream_from_aprfile2(file, FALSE /* disown */,
> > + pool);
> > + SVN_ERR(svn_subst_create_specialfile(&stream,
> > + target->local_abspath,
> > + pool, pool));
> > + SVN_ERR(svn_stream_copy3(patched_stream, stream,
> > + NULL, /* cancel_func */
> > + NULL, /* cancel_baton */
> > + pool));
> > + }
>
> What's the effect of the copy? Isn't svn_subst_create_specialfile() enough?
>

No. svn_subst_create_specialfile() returns a stream, and to create the
special file one should write its repository-normal form to that stream.

That's exactly what the code is doing.

> > + else
> > + {
> > + /* Copy the patched file on top of the target file. */
> > + SVN_ERR(svn_io_copy_file(target->patched_path,
> > + target->local_abspath, FALSE, pool));
> > + }
> > +
Received on 2010-11-12 02:17:17 CET

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.