Status "S" in Subversion
Asked Answered
H

15

81

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?

Heartland answered 8/12, 2009 at 11:57 Comment(3)
Status S means "switched", according to svn h st. What that means, however…Rosenstein
@me_and: Switching working copies: svnbook.red-bean.com/en/1.0/ch04s05.htmlHumour
Just for the record -since it's the closest problem I've found online-, we were having a the S flag issue while trying to merge a branch into trunk. It had to do with the fact that we were using externals. They were removed on the branch but trunk kept referencing them, thus failing to merge. The solution was to remove the externals that we removed on the branch in trunk, commit trunk and reintegrate again. Hope that helps someone along the way :) Cheers!Annamaeannamaria
B
80

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.

Biathlon answered 8/12, 2009 at 12:29 Comment(5)
I've seen this happen also when an "svn switch" command is interrupted by a conflict of some sort, such as the branch you're switching to having a repository version of a local file which isn't committed. Hopping out of svn to fix that leaves the overall working copy incompletely switched over. Resolving the issue and then re-executing the switch command works for me.Cleodal
I had this following an error - E210002: Network connection closed unexpectedly. Re-executing the switch command seemed to fix the problem and the "S" status was gone.Birdcage
Interruption during svn switch IS causing this. Be aware.Meatus
Kevin Sadler actually provides the solution, not just describes the problem. +1Endoblast
Like @KevinSadler said, if you tried to switch from branch1 to branch2 and aborted the merge conflicts then this issue occurs. Solution is to branch2 and then switch back to branch1 svn switch <branch2> followed by svn switch <branch1> solves this issue.Afterheat
R
12

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)

Redemptioner answered 9/12, 2009 at 13:4 Comment(2)
Although not an answer, this 'answer' is very helpful to give some clues as to what's going on.Alyose
this is not an answer.Endoblast
K
10

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.

Kinghood answered 22/9, 2011 at 17:11 Comment(1)
I had a similar error, but I deleted my offending version of "web/.htaccess" (because for me it was several directories) and did svn update, then switched from trunk to a specific tag back to trunk (the specific tag was actually a copy of trunk...) and the erroeneous 'S' flags went away.Selfsufficient
C
6

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).

Copy answered 6/1, 2010 at 0:17 Comment(1)
I had this happen in an svn external after updating to a newer branch. Deleting the entire external manually then running svn update fixed it. +1!Ply
C
5

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.

Cruiser answered 6/7, 2012 at 19:20 Comment(0)
E
5

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

Endoblast answered 1/6, 2016 at 22:16 Comment(0)
A
4

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://[email protected]...' 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.

Along answered 13/1, 2011 at 16:0 Comment(1)
Re-checkouting with the same URI solved it. Thank you.Generalissimo
R
3

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.

Rosenstein answered 8/12, 2009 at 12:13 Comment(2)
Note that the link is to an outdated version of the SVN book. Try here: svnbook.red-bean.com/en/1.5Biathlon
Good spot. Google fails me again.Rosenstein
H
3

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.

Hartzell answered 2/8, 2012 at 10:0 Comment(1)
Yes, I just had this. I had copied a directory of icons from one project to another without deleting the .svn directories. Either export a clean directory to use, or go through and delete the .svn directories after copying, and it will svn add predictably.Ichthyornis
S
1

"Item is switched."

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

Subglacial answered 8/12, 2009 at 12:2 Comment(1)
I've been trying to use the switch command now, but I don't ever get the 'S" in status.. Did you switch? And did you do it in some none-mainstream way?Subglacial
V
1

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

Vaulted answered 30/1, 2018 at 0:31 Comment(1)
In my case the 'S' showed up next to resources that I added from another repo on the same server so the solution I just described above was obvious.Vaulted
M
0

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

Morbilli answered 22/8, 2015 at 5:38 Comment(0)
C
0

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>

Couldst answered 30/11, 2018 at 13:1 Comment(0)
E
0

In the GUI select switch back to parent

Evanthe answered 11/4 at 5:16 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Annorah
O
-6

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
Onfroi answered 21/1, 2013 at 2:3 Comment(1)
RTFM does not answer the question, which was about how to get rid of that status.Guaco

© 2022 - 2024 — McMap. All rights reserved.