You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joerg Hessdoerfer <Jo...@sea-gmbh.com> on 2005/01/16 21:49:35 UTC

SVN can't update write-protected files?!?

Hi,

I've just noticed some troublesome behaiour of SVN on Windows: it can't update 
write-protected files! This works fine under Linux, though:

-------------- transscript -------------------
joe@joelap:~/tmp$ svnadmin create repo
joe@joelap:~/tmp$ svn co file:///home/joe/tmp/repo wc
Checked out revision 0.
joe@joelap:~/tmp$ cd wc
joe@joelap:~/tmp/wc$ touch xx
joe@joelap:~/tmp/wc$ svn add xx
A         xx
joe@joelap:~/tmp/wc$ svn -mtest ci
Adding         xx
Transmitting file data .
Committed revision 1.
joe@joelap:~/tmp/wc$ echo x>xx
joe@joelap:~/tmp/wc$ svn -mtest ci
Sending        xx
Transmitting file data .
Committed revision 2.
joe@joelap:~/tmp/wc$ chmod -r xx
joe@joelap:~/tmp/wc$ svn -r1 up
U  xx
Updated to revision 1.
joe@joelap:~/tmp/wc$ svn --version
svn, version 1.1.1 (r11581)
   compiled Dec 15 2004, 19:22:46

Copyright (C) 2000-2004 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet 
(http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' schema
  - handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' schema
-------------- end transscript --------------

When I do the same on Windows XP:

-------------- transscript -------------------
C:\tmp>svnadmin create repo
C:\tmp>svn co file:///c:/tmp/repo wc
Checked out revision 0.
C:\tmp>cd wc
C:\tmp\wc>echo x>xx
C:\tmp\wc>svn add xx
A         xx
C:\tmp\wc>svn -mtest ci
Adding         xx
Transmitting file data .
Committed revision 1.
C:\tmp\wc>echo x>>xx
C:\tmp\wc>svn -mtest ci
Sending        xx
Transmitting file data .
Committed revision 2.
C:\tmp\wc>attrib +R xx
C:\tmp\wc>svn -r1 up
U  xx
svn: In directory ''
svn: Can't move 'xx.tmp' to 'xx': Zugriff verweigert
C:\tmp\wc>svn --version
svn, version 1.1.2 (r12471)
   compiled Jan  1 2005, 10:21:43

Copyright (C) 2000-2004 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet 
(http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' schema
  - handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' schema
-------------- end transscript --------------

Here 'Zugriff verweigert' is german and means 'Access denied'. Why is this 
behaviour different? A simple 'attrib -R' on the file cures the problem.

Out tools rely heavily on marking files read-only, and it very time consuming 
to check ~15.000 files for read/write flags before any 'svn up', and re-set 
the flags afterwards (we don't really want to integrate svn libs into our 
tools, we would much prefer to have a 'svn up' always succeed...). Is this a 
bug? I would think so, but I did not find any issue for this.

Greetings,
 Joerg
-- 
Leading SW developer  - S.E.A GmbH
Mail: joerg.hessdoerfer@sea-gmbh.com
WWW:  http://www.sea-gmbh.com

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

Re: SVN can't update write-protected files?!?

Posted by Philip Martin <ph...@codematters.co.uk>.
Joerg Hessdoerfer <Jo...@sea-gmbh.com> writes:

> I've just noticed some troublesome behaiour of SVN on Windows: it
> can't update write-protected files! This works fine under Linux,
> though:

Is it a bug that Windows fails to update a "write-protected" file, or
is the bug the fact that Linux does update such a file?

There's a fundamental difference between Linux and Windows: on Linux
the directory permissions determine whether one can delete a file, on
Windows it's the file permissions that matter.  That's an
OS/filesystem difference and nothing to do with Subversion.

Is it reasonable for you to expect Subversion to make those two
different systems behave the same?  Have you any idea how much work
that would be?

> joe@joelap:~/tmp/wc$ chmod -r xx

That doesn't "write-protect" (although "chmod -w" won't make any
difference in this case).

> joe@joelap:~/tmp/wc$ svn -r1 up
> U  xx
> Updated to revision 1.


-- 
Philip Martin

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

Re: SVN can't update write-protected files?!?

Posted by Joerg Hessdoerfer <Jo...@sea-gmbh.com>.
Hi,

On Monday 17 January 2005 00:06, you wrote:
> On Sun, 2005-01-16 at 17:29, Joerg Hessdoerfer wrote:
> > Ok. But why does it work on Linux, then? Your point is somewhat valid,
> > but there's code in SVN that should unprotect the files first, no? And
> > that should either work on all platforms or it's a bug...
>
> On Linux (and other Unix-like systems), not having write permission on a
> file means you can't change it, but you can still delete it or replace
> it if you have appropriate permissions on the directory.  Since
> Subversion updates files by replacing them, we don't notice the lack of
> write permission.
>
> On Windows, the read-only bit means you can't change it, delete it, or
> replace it.
>
> > Besides, some proprietary development environments (we use one) use the
> > read-only flag to notify them that file contents where not changed by the
> > user. So they are set on all locally unmodified files, which SVN would
> > probably want to update. On Linux, this works fine, on Windows not ;-(
>
> I can understand the practical frustration here, but your proprietary
> development environment is essentially saying "no other tools should
> modify this file."  Subversion could be modified to ignore the read-only
> bit, and it might not be a terrible idea (we know the file is under
> version control, so we sorta own it, so it might be okay to override the
> read-only bit on it; also, it would probably be a one-line change), but
> it's not really worth a ?!? in the subject line that we don't do that.
> Would you complain that your editor won't edit the file like you want
> to, that a perl script won't modify the files like you want to, and so
> forth?  Just what do you expect the read-only bit to do?

OK, that's a valid reason. I just wasn't aware of the different semantics of 
this flag (I mostly develop under *nix, so I didn't iterate too deep into 
this).

The problem is, that this ~15.000 files in our working copy, and the tools we 
use to work around this problem take quite a long time, so each update is 
really painful. I was of the impression that the different behavior was a 
deficiency in SVN, but I obviously was wrong. 

The question is, would it be possible to have a sort of 'hooks' inside the svn 
client code (libsvn_wc, ...)? This way, such things which are relevant for 
some dev environs and not for others could be done by add-on tools. The point 
in this would be, that you don't need to modify the client tools themselves, 
but all would act alike.
We have written our own tool, specialized for our dev env, but some developers 
prefer TortoiseSVN (they have valid reasons), and some the commandline, but 
both don't integrate too well into our scenario (read: cause problems, due to 
R/O issues) and our tool is too slow, 'cause it can't anticipate SVNs 
behavior (it would take too long to do so, an 'svn -uv st' takes about 
1.5-3mins on said repository).

I would really love to see something like hooks here, maybe as dynamic loaded 
lib functions? Ideally, they would be called before and after update or 
commit on any file, with some standard args (file path, repo and local 
rev,...). Am I on dope, or this idea worth consideration?

Btw., we really love SVN, it has already saved us some hours or days worth of 
figuring out what went wrong to the code base, and it's rock solid even for 
our bigger products (15.000 files, 750 MBytes source code which are binary 
files).

Thanks,
 Joerg
-- 
Leading SW developer  - S.E.A GmbH
Mail: joerg.hessdoerfer@sea-gmbh.com
WWW:  http://www.sea-gmbh.com

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

Re: SVN can't update write-protected files?!?

Posted by Ben Reser <be...@reser.org>.
On Sun, Jan 16, 2005 at 06:06:49PM -0500, Greg Hudson wrote:
> I can understand the practical frustration here, but your proprietary
> development environment is essentially saying "no other tools should
> modify this file."  Subversion could be modified to ignore the read-only
> bit, and it might not be a terrible idea (we know the file is under
> version control, so we sorta own it, so it might be okay to override the
> read-only bit on it; also, it would probably be a one-line change), but
> it's not really worth a ?!? in the subject line that we don't do that. 
> Would you complain that your editor won't edit the file like you want
> to, that a perl script won't modify the files like you want to, and so
> forth?  Just what do you expect the read-only bit to do?

I am very strongly of the opinion that we should not try and "alter"
Windows filesystem behavior to match *nix platforms.  I understand the
problem with certain development platforms wanting to use that bit in a
certain way.  But to fix this would require us to break people that are
expecting us to follow the platform's permissions.  We can't have it
both ways so we should behave per the platform norms.

I'd be okay if we added a configuration option to force us to ignore
this.  But only in the config file (not command line) and only default
to our current behavior.  But I'm not sure it's worth it to do this.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

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

Re: SVN can't update write-protected files?!?

Posted by Greg Hudson <gh...@MIT.EDU>.
On Sun, 2005-01-16 at 17:29, Joerg Hessdoerfer wrote:
> Ok. But why does it work on Linux, then? Your point is somewhat valid, but 
> there's code in SVN that should unprotect the files first, no? And that 
> should either work on all platforms or it's a bug...

On Linux (and other Unix-like systems), not having write permission on a
file means you can't change it, but you can still delete it or replace
it if you have appropriate permissions on the directory.  Since
Subversion updates files by replacing them, we don't notice the lack of
write permission.

On Windows, the read-only bit means you can't change it, delete it, or
replace it.

> Besides, some proprietary development environments (we use one) use the 
> read-only flag to notify them that file contents where not changed by the 
> user. So they are set on all locally unmodified files, which SVN would 
> probably want to update. On Linux, this works fine, on Windows not ;-(

I can understand the practical frustration here, but your proprietary
development environment is essentially saying "no other tools should
modify this file."  Subversion could be modified to ignore the read-only
bit, and it might not be a terrible idea (we know the file is under
version control, so we sorta own it, so it might be okay to override the
read-only bit on it; also, it would probably be a one-line change), but
it's not really worth a ?!? in the subject line that we don't do that. 
Would you complain that your editor won't edit the file like you want
to, that a perl script won't modify the files like you want to, and so
forth?  Just what do you expect the read-only bit to do?


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

Re: SVN can't update write-protected files?!?

Posted by Joerg Hessdoerfer <Jo...@sea-gmbh.com>.
Hi,

On Sunday 16 January 2005 23:11, Steve Williams wrote:
> I thought that was the whole idea of write-protected (or read-only)
> files.  That they cannot be moved or modified.
>
> Sly
>
[...]

Ok. But why does it work on Linux, then? Your point is somewhat valid, but 
there's code in SVN that should unprotect the files first, no? And that 
should either work on all platforms or it's a bug...

Besides, some proprietary development environments (we use one) use the 
read-only flag to notify them that file contents where not changed by the 
user. So they are set on all locally unmodified files, which SVN would 
probably want to update. On Linux, this works fine, on Windows not ;-(

As I said in my first mail, it's a PITA to set all files to R/W before an 
update, and do a check for local mods and re-set the readonly flag 
afterwards...

Greetings,
 Joerg
-- 
Leading SW developer  - S.E.A GmbH
Mail: joerg.hessdoerfer@sea-gmbh.com
WWW:  http://www.sea-gmbh.com

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

Re: SVN can't update write-protected files?!?

Posted by Steve Williams <st...@kromestudios.com>.
I thought that was the whole idea of write-protected (or read-only) 
files.  That they cannot be moved or modified.

Sly

Joerg Hessdoerfer wrote:
> I've just noticed some troublesome behaiour of SVN on Windows: it can't update 
> write-protected files! This works fine under Linux, though:

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