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

Re: svn commit: rev 5790 - trunk/subversion/libsvn_wc

From: <kfogel_at_collab.net>
Date: 2003-05-03 21:55:17 CEST

Luke Blanshard <luke@blanshard.us> writes:
> Is there ever a time when you want remove_file_if_present to fail on
> Windows because the permissions are wrong? In other words, why not
> simply rewrite remove_file_if_present to set the file read-write
> before removing it, instead of repeating the same logic everywhere?
> Better yet, only do this extra step on systems that actually require
> it -- if you can get APR to encapsulate this.

We used to have similar logic in svn_io_removed_file() too, but it
turned out it was masking some inconsistent assumptions in the calling
code -- a lot of the time, the file was already writeable, and we were
wasting time setting it so.

After that, we made a policy that the low-level removal functions
would always assume that their targets were writeable, and callers
would be responsible for ensuring this. While this decision hasn't
made its way to all the code yet (see issue 1279), I think it's a good
way to go...

-K

> >Author: cmpilato
> >Date: Sat May 3 00:49:23 2003
> >New Revision: 5790
> >
> >Modified:
> > trunk/subversion/libsvn_wc/adm_ops.c
> >Log:
> >* subversion/libsvn_wc/adm_ops.c
> > (svn_wc_remove_from_revision_control): Fixup for revision 5787.
> > If the file you're setting attributes on isn't there, don't sweat it.
> > Should have taken the queue from all those remove_file_***if_present***
> > calls...sheesh...
> >
> >Modified: trunk/subversion/libsvn_wc/adm_ops.c
> >==============================================================================
> >--- trunk/subversion/libsvn_wc/adm_ops.c (original)
> >+++ trunk/subversion/libsvn_wc/adm_ops.c Sat May 3 00:49:23 2003
> >@@ -1648,25 +1648,25 @@
> > /* Text base. */
> > svn_thang = svn_wc__text_base_path (full_path, 0, subpool);
> >- SVN_ERR (svn_io_set_file_read_write (svn_thang, FALSE, subpool));
> >+ SVN_ERR (svn_io_set_file_read_write (svn_thang, TRUE, subpool));
> > SVN_ERR (remove_file_if_present (svn_thang, subpool));
> > /* Working prop file. */
> > SVN_ERR (svn_wc__prop_path (&svn_thang, full_path, adm_access, FALSE,
> > subpool));
> >- SVN_ERR (svn_io_set_file_read_write (svn_thang, FALSE, subpool));
> >+ SVN_ERR (svn_io_set_file_read_write (svn_thang, TRUE, subpool));
> > SVN_ERR (remove_file_if_present (svn_thang, subpool));
> > /* Prop base file. */
> > SVN_ERR (svn_wc__prop_base_path (&svn_thang, full_path, adm_access,
> > FALSE, subpool));
> >- SVN_ERR (svn_io_set_file_read_write (svn_thang, FALSE, subpool));
> >+ SVN_ERR (svn_io_set_file_read_write (svn_thang, TRUE, subpool));
> > SVN_ERR (remove_file_if_present (svn_thang, subpool));
> > /* wc-prop file. */
> > SVN_ERR (svn_wc__wcprop_path (&svn_thang, full_path, adm_access, FALSE,
> > subpool));
> >- SVN_ERR (svn_io_set_file_read_write (svn_thang, FALSE, subpool));
> >+ SVN_ERR (svn_io_set_file_read_write (svn_thang, TRUE, subpool));
> > SVN_ERR (remove_file_if_present (svn_thang, subpool));
> > }
> > ---------------------------------------------------------------------
> >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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat May 3 22:43:21 2003

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.