Status "S" in Subversion

At some point all files in my working copy got marked with "S" symbol as shown below:

$ svn st
M    S   AclController.php
S   InstallationController.php
S   CustomerController.php
S   RedirController.php
S   IndexController.php
S   LoginController.php
S   OrderController.php
S   ProductController.php
S   SelfInstallController.php
S   SelfcareController.php

Interestingly it occurs only int this particular working copy - when I checkout the project to new directory, it does not show the "S" marks.

How to get rid of this annoying "S" symbols? It significantly decreases clarity of WC status.

Update: I do switch from time to time using standard svn switch syntax. It was never causing this "S" symbol to appear until recently. The command used to switch was:

svn switch svn+ssh://xxxxxx/subversion/xxxxxxx/releases/1.0.16 .

Is there any way I can clear the "S" flag?

73877 次浏览

"Item is switched."

If you used "svn switch" on your working copy that might explain it?

This means that you've switched from one working copy to another, for example you've checked out a working copy, then swapped it over to be comparing against a code branch. Take a look at the SVN book for details on how to undo this.

It means that the files are from a different location in your subversion repository than the directory containing them. The solution is to switch the entire working copy to the same location. See the two sections in the subversion book for details on how to invoke the command.

If you call 'svn info' on the directory itself and on (one of) the files inside you will get two different URLs.

You get the 'S' status if the url of a file/directory does not match the URL of the parent followed by the name of the file.

Can you post the url of the parent and one of the child nodes? (anonymizing the URL where appropriate)

I had this problem with a directory I successfully committed to SVN. The solution for me was to erase it locally then update. I couldn't see any differences, but the .svn file was fixed for whatever reason (no more S).

Just a remark: I got the same S symbol when I checked out a deleted directory from the same location in the repository but using a different URL, i.e., using distinct protocols to checkout like 'svn checkout svn+ssh://user@scm.gforge...' against 'svn checkout --username user https://scm.gforge....'. I solved it by checking it out again by using the same URL that I used for the first checkout.

I had 'S' status while switching from trunk (r100) to some branch (r50). I got the error :

svn: Failed to add file 'web/.htaccess': an unversioned file of the same name already exists

All web/'s subdirs were 'S' flagged.

The cause : i had deleted .htaccess to svn:ignore it (r100), then had created it again (unversioned and ignored). The branch (r50) still had web/.htaccess in the repo.

The solution :

mv web/.htaccess ../../
svn switch back to trunk
svn switch to branch again

Everything's fine.

In case anyone is coming in late looking for the answer (which is stated correctly above), I believe a likely CAUSE of this situation is an 'svn switch' on a parent directory that fails (as in the case of a local uncommitted file with the same name, and no --force option), leaving all files subsequent to the failure 'un-switched'.

That is why (assuming the original issue is later corrected) a subsequent 'svn switch' again on the same parent directory will indeed switch the remaining un-switched files to a new repo path.

There's another way in which this status can be achieved - which hopefully will save someone some time tracking it down.

I unpacked an external library into my SVN root, and it turns out the third-party author has accidentally included their own .svn folder in one of their folders. This of course overwrites our own, correct, subversion folder, and has the same effect as described elsewhere on this page - a folder appears to have switched unexpectedly to another branch.

I suggest you read its official help, try:

svn st --help

or

svn st --help | grep S


'S' the item has a Switched URL relative to the parent

For me this happens when "svn switch" command is interrupted and to solve it with TortoriseSVN, I right click on the file and select switch back to parent

This is usually caused by an interruption when switching branches.

Switch to a different branch, and then switch back to the branch you really want.

svn switch some_other_branch_url

svn switch desired_branch_url

A simple solution to get rid of the 'S' when you issue

svn status

is to just go to the dir that is marked with 'S' and delete the hidden .svn directory:

rm -rf .svn

Afterwards the sources show up marked with '?' and you could easily add them freshly:

svn add path/to/resource

In my case two sub-directories in the branch were deleted in the trunk. I switched from trunk the branch from the top level directory, and then moved back to trunk and experience the problem with those sub-directories are now in status S.

I used the answer by @ahnbizcad as a guideline. From the parent directory (which is itself under the top level directory) of the sub-directories:

svn sw <branch_url>

svn sw <trunk_url>