GSto
GSto

Reputation: 42350

how to switch folder to symlink in 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?

Upvotes: 14

Views: 22419

Answers (5)

Alexis Huxley
Alexis Huxley

Reputation: 1

No need to commit between removing thing-as-directory and thing-as-symlink:

svn rm --keep-local <thing>
svn add <thing>

then commit when you're ready.

Upvotes: 0

Yates Zhou
Yates Zhou

Reputation: 51

You could execute command blow to fix this problem.

svn propset svn:special on /project/wwwdocs/js

Upvotes: 1

Soman Dubey
Soman Dubey

Reputation: 3906

You can even try a simple answer of removing culprit file -

svn remove --force <file>

This is especially helpful for Windows users using SVN cli.

Upvotes: 3

Mrk
Mrk

Reputation: 181

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

Upvotes: 18

Damien Wilson
Damien Wilson

Reputation: 4560

In order for subversion to pick up the changes and detect the symlink, you need to first remove the original file, commit the deletion, and then update your repository. After that you should be able to add a symlink without any issues.

EDIT: This question seems to have been asked before and received some decent feedback. Check it out: Commit symlink into subversion

Upvotes: 16

Related Questions