You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Robert Dailey <rc...@gmail.com> on 2008/01/07 20:40:37 UTC

Clean Up & Read-Only Files

Hi,

First of all I just want to say that I only use Subversion through
TortoiseSVN, so I want to apologize ahead of time for not being able to give
you specific command line names or parameters. Hopefully you'll have a
general idea of what I'm talking about though.

Would it be possible for the "Clean Up" operation in TortoiseSVN to make
read-only files that were not made so by locking writable? For example, say
I deliberately go to file properties for a versioned file in my working copy
and make it read-only. If I do a clean-up, it should see that this file is
read-only when i do not own a lock (or if there was no lock to begin with)
to that file. It should then proceed to remove the read-only attribute from
the file.


Thanks.

RE: Re: Clean Up & Read-Only Files

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com]
> Sent: Wednesday, January 09, 2008 3:35 PM
> To: Andy Levy
> Cc: Robert Dailey; svn
> Subject: Re: Clean Up & Read-Only Files
> 
> > I'm manually copying files from a team foundation server to my SVN
> > repository, which yields many read-only files that need to be
> > converted to
> > writable status after being moved to my SVN working copy directory.
> > Doing
> > this through windows explorer is a very slow process as the ratio of
> > writable files to read-only files is probably 10,000:1. The Cleanup
> > feature,
> > which seems a lot smarter than a generic tree search, could
> > probably achieve
> > this goal much quicker for me.


Use the command line.  Start -> Run, cmd.exe  Refer to 'help dir', 'help
attrib', 'help find', and 'help for'.

"dir /s/b/a-d/ar" will find any read-only files.  'Attrib -r' will
remove the read-only bit.  You can't use 'attrib /s' since that will
walk into the .svn dirs.  'find' is a low class grep you use to exclude
the '.svn' dirs.  'for' is a looping statement that's complicated even
by IRS standards.

Solution:
	dir /s/b/a-d/ar | find /v "\.svn\" > a.txt
	for /f %i in (a.txt) do attrib -r "%i"

If you don't want to see the commands as they run, add the '@' to
attrib, like so:
	for /f %i in (a.txt) do @attrib -r "%i"


And yes, this is still mostly on topic as an fyi, since Windows users
need a way to fix/process/scan a workspace without stepping on the .svn
dirs.  (Granted you really should install Cygwin and learn ksh/bash, but
that's a different story.)


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


Re: Clean Up & Read-Only Files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 9, 2008, at 06:13, Andy Levy wrote:

> On Jan 8, 2008 9:58 PM, Ryan Schmidt wrote:
>
>> On Jan 7, 2008, at 14:40, Robert Dailey wrote:
>>
>>> Would it be possible for the "Clean Up" operation in TortoiseSVN to
>>> make read-only files that were not made so by locking writable? For
>>> example, say I deliberately go to file properties for a versioned
>>> file in my working copy and make it read-only. If I do a clean-up,
>>> it should see that this file is read-only when i do not own a lock
>>> (or if there was no lock to begin with) to that file. It should
>>> then proceed to remove the read-only attribute from the file.
>>
>> I don't see why Subversion should do this. What's your justification
>> for this proposed change?
>
> For reference, the original thread on the TSVN mailing list:
> http://svn.haxx.se/tsvnusers/archive-2008-01/0087.shtml

Ok, I've read the original thread now. Robert, quoting your message  
from TSVN Users:

http://svn.haxx.se/tsvnusers/archive-2008-01/0091.shtml

On Mon, 7 Jan 2008 16:05:44 -0600 Robert Dailey wrote:

> I'm manually copying files from a team foundation server to my SVN
> repository, which yields many read-only files that need to be  
> converted to
> writable status after being moved to my SVN working copy directory.  
> Doing
> this through windows explorer is a very slow process as the ratio of
> writable files to read-only files is probably 10,000:1. The Cleanup  
> feature,
> which seems a lot smarter than a generic tree search, could  
> probably achieve
> this goal much quicker for me.

It seems your problem of undesirably read-only files originates  
outside of Subversion. Therefore, it's really no business of  
Subversion's to fix it for you, especially since, as Andy pointed out  
in the original thread, Subversion has no way to know that the read- 
only attribute is unintended. Subversion is not a generic file  
attribute modification tool, and "svn cleanup" exists for the sole  
purpose of getting the working copy back into a usable state after a  
Subversion process has crashed or been unexpectedly interrupted.  
Arbitrarily changing the read-only attribute of files is not  
necessary to accomplish that goal. It sounds like all you really want  
is a script which can remove the read-only attribute of many files at  
once. So you should write such a script, or find one that someone  
else has already written. This function doesn't belong in Subversion.


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

Re: Clean Up & Read-Only Files

Posted by Andy Levy <an...@gmail.com>.
On Jan 8, 2008 9:58 PM, Ryan Schmidt <su...@ryandesign.com> wrote:
>
> On Jan 7, 2008, at 14:40, Robert Dailey wrote:
>
> > First of all I just want to say that I only use Subversion through
> > TortoiseSVN, so I want to apologize ahead of time for not being
> > able to give you specific command line names or parameters.
> > Hopefully you'll have a general idea of what I'm talking about though.
> >
> > Would it be possible for the "Clean Up" operation in TortoiseSVN to
> > make read-only files that were not made so by locking writable? For
> > example, say I deliberately go to file properties for a versioned
> > file in my working copy and make it read-only. If I do a clean-up,
> > it should see that this file is read-only when i do not own a lock
> > (or if there was no lock to begin with) to that file. It should
> > then proceed to remove the read-only attribute from the file.
>
> I don't see why Subversion should do this. What's your justification
> for this proposed change?

For reference, the original thread on the TSVN mailing list:
http://svn.haxx.se/tsvnusers/archive-2008-01/0087.shtml

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

Re: Clean Up & Read-Only Files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 7, 2008, at 14:40, Robert Dailey wrote:

> First of all I just want to say that I only use Subversion through  
> TortoiseSVN, so I want to apologize ahead of time for not being  
> able to give you specific command line names or parameters.  
> Hopefully you'll have a general idea of what I'm talking about though.
>
> Would it be possible for the "Clean Up" operation in TortoiseSVN to  
> make read-only files that were not made so by locking writable? For  
> example, say I deliberately go to file properties for a versioned  
> file in my working copy and make it read-only. If I do a clean-up,  
> it should see that this file is read-only when i do not own a lock  
> (or if there was no lock to begin with) to that file. It should  
> then proceed to remove the read-only attribute from the file.

I don't see why Subversion should do this. What's your justification  
for this proposed change?

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