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

moving a file on top of a link issue?

From: tim gunter <tgunter_at_gmail.com>
Date: 2007-03-02 09:12:25 CET

I believe I may have found a minor bug. I have experienced this issue using
svn 1.4.2 under
cygwin, and 1.4.3 on linux.

I have a working copy in which I had a symbolic link pointing to another
file. At some point,
I deleted the link, and moved its target on top of the link. Later on,
after editing the file and
then reverting it, svn appears to have replaced the contents of the file
with "link file". The
following script should reproduce the issue:

   #!/bin/bash

   SVN=svn
   SVNADMIN=svnadmin

   # create working dir
   WDIR=svntemp
   [ -d $WDIR ] && echo "ERROR: $WDIR already exists! please remove" && exit
1
   mkdir $WDIR
   cd $WDIR

   # create depot
   $SVNADMIN create .svn-depot
   $SVN co "file:///$(pwd)/.svn-depot" .

   # create text file & link to file
   cat <<EOF > file
   this is a text file
   EOF
   ln -s file myfile

   # add to depot
   $SVN add file myfile
   $SVN ci -m "added \"file\" & link \"myfile\""

   # remove link & move file on top of link
   $SVN rm myfile
   $SVN mv file myfile
   $SVN ci -m "removed link, and moved file on top of link"

   # modify file
   echo "modifying file"
   cat <<EOF >> myfile
   more text appended to file
   EOF

   # diff against base
   echo "diff -y myfile <($SVN cat myfile):"
   diff -y myfile <($SVN cat myfile)

   # revert
   echo "revert:"
   $SVN revert myfile

   # diff against base
   echo "diff -y myfile <($SVN cat myfile):"
   diff -y myfile <($SVN cat myfile)

   echo "diff -y myfile <($SVN cat -r HEAD myfile):"
   diff -y myfile <($SVN cat -r HEAD myfile)

   cd ..

This may be somewhat related to issue
2622<http://subversion.tigris.org/issues/show_bug.cgi?id=2622>except
that I am able to successfully
replace the link.

Is there an easy way to fix a working copy in this state?

Thanks to the developers; svn is a joy to use!

--tim
Received on Fri Mar 2 09:12:51 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.