You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by tim gunter <tg...@gmail.com> on 2007/03/02 08:12:25 UTC

moving a file on top of a link issue?

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