Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to switch folder to symlink in svn

Tags:

svn

I had a folder that was part of one project in svn, that has been moved to a different folder / repository to be shared between projects. i want to replace this directory in svn w/ a symlink, but when I try to do so, I get this message:

svn: Entry '/project/wwwdocs/js' has unexpectedly changed special status

how can I replace this directory with a symlink?

like image 846
GSto Avatar asked Mar 15 '11 13:03

GSto


1 Answers

The following sets the special property on every symlink and deletes it on normal files/directories. There are various ways to the determine the files to operate on.

svn_special_files=`svn propget --recursive svn:special | cut -d' ' -f1`
for i in `find . | grep -v "\.svn" | cut -d'/' -f2-`; do
  is_special=false
  for j in $svn_special_files; do 
    if [ "$j" = "$i" ]; then 
      is_special=true; 
      break; 
    fi
  done
  if [ -h $i ] ; then
    ! $is_special && svn propset svn:special '*' $i
  else
    $is_special && svn propdel svn:special $i
  fi
done
like image 182
Mrk Avatar answered Oct 22 '22 10:10

Mrk