You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2010/11/12 01:14:13 UTC

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

Stefan Sperling wrote on Fri, Nov 12, 2010 at 01:07:53 +0100:
> On Thu, Nov 11, 2010 at 09:21:26PM -0000, dannas@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));
> > +            }
> > +

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

Posted by Daniel Näslund <da...@longitudo.com>.
On Fri, Nov 12, 2010 at 03:14:13AM +0200, Daniel Shahaf wrote:
> Stefan Sperling wrote on Fri, Nov 12, 2010 at 01:07:53 +0100:
> > On Thu, Nov 11, 2010 at 09:21:26PM -0000, dannas@apache.org wrote:

> > > Add support for handling symlinks in 'svn patch'.
> > If you haven't done so, can you close the corresponding issue, too?
> 
> Issue #3697.

You beat me too it, sorry about beeing so slow. :)

Daniel (dannas)