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

[PATCH] Fix for reverting broken softlinks

From: David O'Shea <david.oshea_at_s3group.com>
Date: 2007-10-17 09:35:41 CEST

Hi,

I sent this on yesterday but it never seemed to show up on the list,
(possibly because the address I sent it from was not the one I'd
subscribed with?) so I'm resending - apologies if it turns up twice.

David.

--------------------------- Original Message ---------------------------

Hi,

The attached patch fixes the case where you're trying to revert a
working copy with broken softlinks. Steps to reproduce the existing
problem are as follows:

$ touch foo
$ ln -s foo bar
$ svn add foo bar
$ svn ci -m "Adding link for testing purposes."
$ ln -sf fish bar
$ svn revert bar

This will result in the error message:

svn: Can't open file 'bar': No such file or directory

[[[
Fix for reverting WC with broken softlinks.

* subversion/libsvn_wc/questions.c
    (compare_and_verify): Do not attempt to read untranslated special files.

]]]

Regards,

David.

The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
Please direct any additional queries to: communications@s3group.com.
Thank You.
Silicon and Software Systems Limited. Registered in Ireland no. 378073.
Registered Office: Whelan House, South County Business Park, Leopardstown, Dublin 18

--- subversion/libsvn_wc/questions.c 2006-07-10 20:36:44.000000000 +0100
+++ subversion/libsvn_wc/questions.c 2007-10-15 11:21:13.000000000 +0100
@@ -308,8 +308,22 @@
         }
       else
         {
- SVN_ERR(svn_io_file_open(&v_file_h, versioned_file, APR_READ,
- APR_OS_DEFAULT, pool));
+ if (special)
+ {
+ const char *dst_tmp;
+ SVN_ERR(svn_io_open_unique_file2(&v_file_h, &dst_tmp, versioned_file,
+ ".tmp", svn_io_file_del_on_close, pool));
+ SVN_ERR(svn_subst_copy_and_translate3(versioned_file, dst_tmp,
+ eol_str, FALSE,
+ keywords, FALSE,
+ special, pool));
+ }
+ else
+ {
+ SVN_ERR(svn_io_file_open(&v_file_h, versioned_file, APR_READ,
+ APR_OS_DEFAULT, pool));
+ }
+
           v_stream = svn_stream_from_aprfile2(v_file_h, FALSE, pool);
 
           if (need_translation)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 17 11:29:36 2007

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.