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

Re: Problem with symbolic links on windows introduced on trunk somewhere between revision 22556 and 22778

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-01-09 14:29:21 CET

On Tue, Jan 09, 2007 at 10:59:53AM +0100, Marc Haesen wrote:
> I did some debugging and if I apply the following patch, the problem disappears. It seems that the code is trying to create a temporary file twice.
>
> The patch file is generated on windows (so it contains cr/lf)
>
> Regards,
> Marc
>
> > When I checkout a directory containing a symbolic link on windows with a
> > client build from trunk (last revision I tried was 22811), I get the
> > following error message:
> >
> > svn: REPORT request failed on '/svnrepos/repos/!svn/vcc/default'
> > svn: In directory 'xxxx'
> > svn: Can't open file 'xxxx\.svn\tmp\file.ext.tmp.tmp': The file exists.
> >

Content-Description: patch.txt
> Index: subversion/libsvn_subr/subst.c
> ===================================================================
> --- subversion/libsvn_subr/subst.c (revision 22939)
> +++ subversion/libsvn_subr/subst.c (working copy)
> @@ -1610,7 +1610,6 @@
> /* Fall back to just copying the text-base. */
> SVN_ERR(svn_io_open_unique_file2(NULL, &dst_tmp, dst, ".tmp",
> svn_io_file_del_none, pool));
> - SVN_ERR(svn_io_file_create(dst_tmp, src->data, pool));
> }
> else
> return err;

That'll work in the sense that it won't give you an error, but it won't
populate the new contents of the new file (which should contain the
internal representation of the linke, it seems).

The problem is that svn_io_file_create() is failing because the
temporary file exists. Something like the attached should work, though
I can't test it.

Annoyingly, we don't have any symlink tests on Windows (because we can't
create symlinks there). We should fix that.

Regards,
Malcolm

Index: subversion/libsvn_subr/subst.c
===================================================================
--- subversion/libsvn_subr/subst.c (revision 22938)
+++ subversion/libsvn_subr/subst.c (working copy)
@@ -1606,11 +1606,18 @@
     {
       if (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
         {
+ apr_file_t *dst_tmp_file;
+ apr_size_t written;
+
           svn_error_clear(err);
+
           /* Fall back to just copying the text-base. */
- SVN_ERR(svn_io_open_unique_file2(NULL, &dst_tmp, dst, ".tmp",
- svn_io_file_del_none, pool));
- SVN_ERR(svn_io_file_create(dst_tmp, src->data, pool));
+ SVN_ERR(svn_io_open_unique_file2(&dst_tmp_file, &dst_tmp,
+ dst, ".tmp", svn_io_file_del_none,
+ pool));
+ SVN_ERR(svn_io_file_write_full(dst_tmp_file, src->data, src->len,
+ &written, pool));
+ SVN_ERR(svn_io_file_close(dst_tmp_file, pool));
         }
       else
         return err;

  • application/pgp-signature attachment: stored
Received on Tue Jan 9 14:29:54 2007

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