You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@newton.ch.collab.net> on 2002/05/07 14:31:46 UTC

Re: svn commit: rev 1893 - trunk/subversion/libsvn_subr

brane@tigris.org writes:
> Log:
> On Win32, a file can't be deleted if its read-only attribute is set.
> 
> * subversion/libsvn_subr/io.c (apr_dir_remove_recursively): Clear the
> read-only attribute before removing a file.

Is this the behavior we want for remove_recursively(), though?  Just
curious what the circumstance was that led to this change...  Was it
trying to remove a .svn subdir and failing?

-K

> Modified: trunk/subversion/libsvn_subr/io.c
> ==============================================================================
> --- trunk/subversion/libsvn_subr/io.c	(original)
> +++ trunk/subversion/libsvn_subr/io.c	Tue May  7 08:27:24 2002
> @@ -902,6 +902,13 @@
>          }
>        else if (this_entry.filetype == APR_REG)
>          {
> +          status = apr_file_attrs_set (fullpath,
> +                                       0,
> +                                       APR_FILE_ATTR_READONLY,
> +                                       subpool);
> +          if (status && status != APR_ENOTIMPL)
> +            return status;
> +
>            status = apr_file_remove (fullpath, subpool);
>            if (! (APR_STATUS_IS_SUCCESS (status))) return status;
>          }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1893 - trunk/subversion/libsvn_subr

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Branko Čibej <br...@xbc.nu> writes:
> Exactly. Sorry, I should've written that to the log.

Oh, you still can if you want :-).

> What actually triggered the problem for me was updating on Windows
> after the expat-lite dir was removed from the repo. The update failed,
> because it couldn't remove the various read-only files in
> expat-lite/.svn. I had to remove them by hand, "svn cleanup" and "svn
> up" again to get it working.
> 
> This fix solves this particular problem, which also showed up in
> python tests on Win32.

Gotcha, thanks.

> On another note: I feel we should rename that funciton to
> svn_dir_remove. If we want to get something into APR, I'd rather see
> an apr_dir_recurse that takes a callback, and implement svn_dir_remove
> on top of that. IIRC we discussed that some time ago. Thoughts?

I think it's fine.  We're not lurching very hard in the direction of
getting it incorporated into apr, and it's not essential that we do
so.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1893 - trunk/subversion/libsvn_subr

Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:

>brane@tigris.org writes:
>  
>
>>Log:
>>On Win32, a file can't be deleted if its read-only attribute is set.
>>
>>* subversion/libsvn_subr/io.c (apr_dir_remove_recursively): Clear the
>>read-only attribute before removing a file.
>>    
>>
>
>Is this the behavior we want for remove_recursively(), though?  Just
>curious what the circumstance was that led to this change...  Was it
>trying to remove a .svn subdir and failing?
>
Exactly. Sorry, I should've written that to the log.

What actually triggered the problem for me was updating on Windows after 
the expat-lite dir was removed from the repo. The update failed, because 
it couldn't remove the various read-only files in expat-lite/.svn. I had 
to remove them by hand, "svn cleanup" and "svn up" again to get it working.

This fix solves this particular problem, which also showed up in python 
tests on Win32.

On another note: I feel we should rename that funciton to 
svn_dir_remove. If we want to get something into APR, I'd rather see an 
apr_dir_recurse that takes a callback, and implement svn_dir_remove on 
top of that. IIRC we discussed that some time ago. Thoughts?

>-K
>
>  
>
>>Modified: trunk/subversion/libsvn_subr/io.c
>>==============================================================================
>>--- trunk/subversion/libsvn_subr/io.c	(original)
>>+++ trunk/subversion/libsvn_subr/io.c	Tue May  7 08:27:24 2002
>>@@ -902,6 +902,13 @@
>>         }
>>       else if (this_entry.filetype == APR_REG)
>>         {
>>+          status = apr_file_attrs_set (fullpath,
>>+                                       0,
>>+                                       APR_FILE_ATTR_READONLY,
>>+                                       subpool);
>>+          if (status && status != APR_ENOTIMPL)
>>+            return status;
>>+
>>           status = apr_file_remove (fullpath, subpool);
>>           if (! (APR_STATUS_IS_SUCCESS (status))) return status;
>>         }
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
>>For additional commands, e-mail: svn-help@subversion.tigris.org
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
>
>  
>


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org