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