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

File permissions are incorrect after directory copy in 1.7

From: Fergus Slorach <sugref_at_gmail.com>
Date: Sun, 27 May 2012 09:56:40 +1200

In Subversion 1.7.5:

If a directory containing svn:needs-lock files is copied and
committed, the needs-lock files are left writeable.

The writeable state can be resolved by running 'svn revert' on
the files, even though the status indicates there is nothing to
revert.

Recipe and run-through results below.

Thanks,

fergus

Recipe:

cd /tmp
svnadmin create repos
svn co file:///tmp/repos/ copy_test
cd copy_test
svn mkdir foo
touch foo/bar.txt
svn add foo/bar.txt
svn propset svn:needs-lock 1 foo/bar.txt
svn commit -m 'Added'
svn copy foo goo
svn commit -m 'Copied'
ls -l goo # goo/bar.txt is writeable
svn st -u -v goo # goo/bar.txt has no status
svn revert goo/bar.txt # goo/bar.txt is reverted
ls -l goo # goo/bar.txt is now read-only

Run of the recipe:

/tmp $ cd /tmp
/tmp $ svnadmin create repos
/tmp $ svn co file:///tmp/repos/ copy_test
Checked out revision 0.
/tmp $ cd copy_test
/tmp/copy_test $ svn mkdir foo
A foo
/tmp/copy_test $ touch foo/bar.txt
/tmp/copy_test $ svn add foo/bar.txt
A foo/bar.txt
/tmp/copy_test $ svn propset svn:needs-lock 1 foo/bar.txt
property 'svn:needs-lock' set on 'foo/bar.txt'
/tmp/copy_test $ svn commit -m 'Added'
Adding foo
Adding foo/bar.txt
Transmitting file data .
Committed revision 1.
/tmp/copy_test $ svn copy foo goo
A goo
/tmp/copy_test $ svn commit -m 'Copied'
Adding goo

Committed revision 2.
/tmp/copy_test $ ls -l goo
total 0
-rw-rw-r-- 1 fergus fergus 0 May 27 09:45 bar.txt
/tmp/copy_test $ svn revert goo/bar.txt
Reverted 'goo/bar.txt'
/tmp/copy_test $ ls -l goo
total 0
-r--r--r-- 1 fergus fergus 0 May 27 09:45 bar.txt
/tmp/copy_test $ svn revert goo/bar.txt
Received on 2012-05-26 23:57:21 CEST

This is an archived mail posted to the Subversion Dev mailing list.