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

Bug: Renaming of symlinks create invalid commits

From: Øyvind A. Holm <sunny_at_sunbase.org>
Date: 2004-07-04 08:00:13 CEST

When committing a "svn mv old_symlink new_symlink", svn:specials is
emptied, but the commit does not complete. This makes it impossible to
check out the symlink with svn from trunk, it does not recognise the
special file type as it is empty. svn cleanup, svn revert or svn update
does not work, even if a fresh copy is checked out. The following script
reproduces the error and makes svn abort during all the subsequent
updates/checkouts:

#!/bin/bash

mkdir wc repos 2>/dev/null
[ -d "repos/." ] || { echo "Repository parent dir not found" >&2; exit 1; }
[ -d "wc/." ] || { echo "wc parent dir not found" >&2; exit 1; }
subrepos=test.$(date +"%H_%M_%S")
repos=$(/bin/pwd)/repos/$subrepos
echo === Creating repository in "$repos"...
svnadmin create $repos
cd wc || { echo "cd wc: Error" >&2; exit 1; }
echo === Checking out empty wc...
svn co file://$repos $subrepos
echo === cd $subrepos
cd $subrepos || { echo "cd $subrepos: Error" >&2; exit 1; }
echo === svn mkdir trunk
svn mkdir trunk
echo === Checkin empty trunk
svn ci -m "Added trunk"
echo === cd trunk
cd trunk
echo === Create regular file regular.txt
echo This is a regular file >regular.txt
echo === svn add regular.txt
svn add regular.txt
echo === Checkin regular.txt
svn ci -m "Adding regular file"
echo === ln -sv regular.txt symlink.txt
ln -sv regular.txt symlink.txt
echo === svn add symlink.txt
svn add symlink.txt
echo === Check in symlink
svn ci -m "Adding symlink to regular.txt"
echo === svn update
svn up
echo === svn mv symlink.txt newsymlink.txt
svn mv symlink.txt newsymlink.txt
echo === svn st -v
svn st -v
echo === Checkin move of symlink.txt to newsymlink.txt
svn ci -m "Moving symlink.txt to newsymlink.txt"
echo === svn st -v
svn st -v
echo -n "### PRESS ENTER..."; read
echo === svn up
svn up
echo === svn cleanup
svn cleanup
echo -n "### PRESS ENTER..."; read
echo === svn revert -R .
svn revert -R .
echo -n "### PRESS ENTER..."; read
echo "=== cd ..; rm -rf trunk"
cd ..
rm -rf trunk
echo === svn up
svn up

This is a log session of what happens when a similar operation is done:

=== PROMPT 05:57:17 sunny_at_ba0614:~/src/svn$ export TD=file:///home/sunny/Svn/linktest
=== PROMPT 05:58:09 sunny@ba0614:~/src/svn$ svnadmin create /home/sunny/Svn/linktest
=== PROMPT 05:58:32 sunny@ba0614:~/src/svn$ svn co $TD
Checked out revision 0.
=== PROMPT 05:58:57 sunny@ba0614:~/src/svn$ cd linktest/
=== PROMPT 05:59:06 sunny@ba0614:~/src/svn/linktest$ l
totalt 12
drwxr-xr-x 3 sunny sunny 4096 2004-07-04 05:58 .
drwxr-xr-x 24 sunny sunny 4096 2004-07-04 05:58 ..
drwxr-xr-x 7 sunny sunny 4096 2004-07-04 05:58 .svn
=== PROMPT 05:59:08 sunny@ba0614:~/src/svn/linktest$ svn mkdir trunk
A trunk
=== PROMPT 05:59:14 sunny@ba0614:~/src/svn/linktest$ svn ci -m "Added trunk"
Adding trunk

Committed revision 1.
=== PROMPT 05:59:22 sunny@ba0614:~/src/svn/linktest$ cd trunk/
=== PROMPT 05:59:27 sunny@ba0614:~/src/svn/linktest/trunk$ echo This is a regular file >regular.txt
=== PROMPT 05:59:43 sunny@ba0614:~/src/svn/linktest/trunk$ svn add regular.txt
A regular.txt
=== PROMPT 05:59:46 sunny@ba0614:~/src/svn/linktest/trunk$ svn ci -m "Adding regular file"
Adding trunk/regular.txt
Transmitting file data .
Committed revision 2.
=== PROMPT 06:00:04 sunny@ba0614:~/src/svn/linktest/trunk$ ln -sv regular.txt symlink.txt
create symbolic link `symlink.txt' to `regular.txt'
You have new mail in /var/mail/sunny
=== PROMPT 06:00:27 sunny@ba0614:~/src/svn/linktest/trunk$ svn add symlink.txt
A symlink.txt
=== PROMPT 06:00:45 sunny@ba0614:~/src/svn/linktest/trunk$ svn ci -m "Adding symlink to regular.txt"
Adding trunk/symlink.txt
Transmitting file data .
Committed revision 3.
=== PROMPT 06:01:03 sunny@ba0614:~/src/svn/linktest/trunk$ svn up
At revision 3.
=== PROMPT 06:01:20 sunny@ba0614:~/src/svn/linktest/trunk$ svn log -v
------------------------------------------------------------------------
r3 | sunny | 2004-07-04 06:01:02 +0200 (Sun, 04 Jul 2004) | 1 line
Changed paths:
   A /trunk/symlink.txt

Adding symlink to regular.txt
------------------------------------------------------------------------
r2 | sunny | 2004-07-04 05:59:54 +0200 (Sun, 04 Jul 2004) | 1 line
Changed paths:
   A /trunk/regular.txt

Adding regular file
------------------------------------------------------------------------
r1 | sunny | 2004-07-04 05:59:21 +0200 (Sun, 04 Jul 2004) | 1 line
Changed paths:
   A /trunk

Added trunk
------------------------------------------------------------------------
=== PROMPT 06:01:26 sunny@ba0614:~/src/svn/linktest/trunk$ svn st
=== PROMPT 06:01:41 sunny@ba0614:~/src/svn/linktest/trunk$ svn mv symlink.txt newsymlink.txt
A newsymlink.txt
D symlink.txt
=== PROMPT 06:01:55 sunny@ba0614:~/src/svn/linktest/trunk$ svn st -v
                3 3 sunny .
                3 2 sunny regular.txt
D 3 3 sunny symlink.txt
~ + - ? ? newsymlink.txt
=== PROMPT 06:02:01 sunny@ba0614:~/src/svn/linktest/trunk$ svn st newsymlink.txt
~ + newsymlink.txt
=== PROMPT 06:02:10 sunny@ba0614:~/src/svn/linktest/trunk$ svn ci -m "Moving symlink.txt to newsymlink.txt"
Adding trunk/newsymlink.txt
Deleting trunk/symlink.txt
Transmitting file data .subversion/libsvn_client/commit.c:771: (apr_err=200000)
svn: Commit succeeded, but other errors follow:
subversion/libsvn_client/commit.c:789: (apr_err=155009)
svn: Error bumping revisions post-commit (details follow):
subversion/libsvn_wc/log.c:329: (apr_err=155009)
svn: In directory '/home/badata/src/svn/linktest/trunk'
subversion/libsvn_wc/log.c:1236: (apr_err=155009)
svn: Error processing command 'committed' in '/home/badata/src/svn/linktest/trunk'
subversion/libsvn_wc/log.c:1006: (apr_err=155009)
svn: Error replacing text-base of 'newsymlink.txt'
subversion/libsvn_subr/subst.c:836: (apr_err=200007)
svn: Unsupported special file type ''
=== PROMPT 06:02:47 sunny@ba0614:~/src/svn/linktest/trunk$ svn st
  L .
D symlink.txt
~ + newsymlink.txt
=== PROMPT 06:02:55 sunny@ba0614:~/src/svn/linktest/trunk$ svn up
subversion/libsvn_wc/lock.c:157: (apr_err=155004)
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
=== PROMPT 06:03:01 sunny@ba0614:~/src/svn/linktest/trunk$ svn cleanup
subversion/libsvn_wc/log.c:329: (apr_err=155009)
svn: In directory ''
subversion/libsvn_wc/log.c:1236: (apr_err=155009)
svn: Error processing command 'committed' in ''
subversion/libsvn_wc/log.c:1006: (apr_err=155009)
svn: Error replacing text-base of 'newsymlink.txt'
subversion/libsvn_subr/subst.c:836: (apr_err=200007)
svn: Unsupported special file type ''
=== PROMPT 06:03:06 sunny@ba0614:~/src/svn/linktest/trunk$ svn st
  L .
D symlink.txt
~ + newsymlink.txt
=== PROMPT 06:03:14 sunny@ba0614:~/src/svn/linktest/trunk$ svn revert -R .
subversion/libsvn_wc/lock.c:157: (apr_err=155004)
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
=== PROMPT 06:03:20 sunny@ba0614:~/src/svn/linktest/trunk$ svn up
subversion/libsvn_wc/lock.c:157: (apr_err=155004)
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
=== PROMPT 06:03:22 sunny@ba0614:~/src/svn/linktest/trunk$ cd ..
=== PROMPT 06:03:24 sunny@ba0614:~/src/svn/linktest$ rm -rf trunk
=== PROMPT 06:03:27 sunny@ba0614:~/src/svn/linktest$ svn up
A trunk
A trunk/regular.txt
A trunk/newsymlink.txt
subversion/libsvn_wc/log.c:329: (apr_err=155009)
svn: In directory 'trunk'
subversion/libsvn_subr/subst.c:836: (apr_err=200007)
svn: Unsupported special file type ''
=== PROMPT 06:03:34 sunny@ba0614:~/src/svn/linktest$ cd ..
=== PROMPT 06:03:36 sunny@ba0614:~/src/svn$ rm -rf linktest
=== PROMPT 06:03:40 sunny@ba0614:~/src/svn$ svn co $TD
A linktest/trunk
A linktest/trunk/regular.txt
A linktest/trunk/newsymlink.txt
subversion/libsvn_wc/log.c:329: (apr_err=155009)
svn: In directory 'linktest/trunk'
subversion/libsvn_subr/subst.c:836: (apr_err=200007)
svn: Unsupported special file type ''
=== PROMPT 06:03:50 sunny@ba0614:~/src/svn$ # urgh

Tested against r10131
Debian testing (sarge), nicely updated
gcc-2.95.4
ldd (GNU libc) 2.2.5
apr from apache-2.0.49

Regards,
Øyvind A. Holm
---------------------
cat /dev/urandom >SCO

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jul 4 08:00:59 2004

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.