subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Canfield <andy.canfi...@pimco.mobi>
Subject Re: Bug in Subversion regarding file attributes
Date Sun, 21 Aug 2011 13:02:06 GMT


On 08/21/2011 06:48 PM, Andy Levy wrote:
> On Sun, Aug 21, 2011 at 07:21, Andy Canfield<andy.canfield@pimco.mobi>  wrote:
>> I created a repository and created a subdirectory in it named 'scripts'. In
>> this are a half-dozen Linux shell scripts. Unfortunately, I set the execute
>> flag on only five of them; the sixth was untested as of my first commit so I
>> had never noticed that the execute attribute was unset.
>>
>> [1] I set the execute attribute and did a commit, but the file was not
>> updated in the repository. Apparently the change in atributes was not
>> recognized as a file change by Subversion.
> If the file's timestamp didn't change, Subversion won't pick up the change.
So does this mean that if the file's timestamp does not change, but the 
files's contents change, Subversion will not pick up the changed 
contents; svn only looks at the file's contents if the timestamp 
changes? No checksum or filesize check, only the timestamp is used to 
detect changes?
>> [2] I touched the file - I touched ALL the files in scripts, and none of
>> them was updated on the commit. Apparently the file timestamp change was not
>> taken as a file change by Subversion. OK, Subversion is not storing
>> timestamps.
> If a change in the timestamp is detected, a checksum is done against
> each file's pristine copy (and properties). If the checksums&
> properties match, Subversion doesn't flag the file as changed.
And according to [3], even if Subversion picks up the file as changed, 
it does not pick up the attributes of the file as changed.
>> [3] I edited the file, and this was taken as an update by Subversion. I just
>> added a blank line to the end of it. But note that the file attributes now
>> include the execute flag. I did another checkout, and unfortunately the
>> execute flag is STILL not set.
>>
>> In my humble opinion [1] and [3] should have resulted in the file attributes
>> stored in the repository being changed.
> I disagree on #1, but for #3 I think it's only picked up when you Add the file.
Yeah, that's what it looks like. The file's attribues are set when it is 
first added, and never changed thereafter.
>> So I did an svn delete for that file, then a commit. I restored the file
>> from a backup, set the attributes, did an svn add for that file, then a
>> commit. Went to another directory and did an svn checkout. OK; now the
>> attributes are correct.
> You could have also set the svn:executable property on the file. If
> you look at your newly-added copy of the file, you'll see that
> property set now.
>
I am having a similar problem now with directories that need to be 
globally readable. This happens because the repository contains a web 
site, and the user ('andy') who checks out the repository is not the 
user (Apache: www-data) who runs the PHP code. I have created scripts to 
handle this but the user has to remember to run the script every time he 
does a checkout. AFAIK there is no "svn:writable" property.

I am beginning to see that Subversion manages the CONTENTS of the files, 
but does not do well at managing the ATTRIBUTES of the files.


Mime
View raw message