66

The Subversion manual states:

'!'

Item is missing (e.g. you moved or deleted it without using svn). This also indicates that a directory is incomplete (a checkout or update was interrupted).

But as so often with Subversion, there is no indication on how to fix the problem.

Normally, I would use my trusted Fix_Subversion.command but this time it is trunk and it will take forever.

So is there any faster option?

JPaget
  • 969
  • 10
  • 13
Martin
  • 11,577
  • 16
  • 80
  • 110

6 Answers6

74
svn revert /path/to/file
svn rm /path/to/file      # if you want to delete it from svn itself

Golden rule is: once something is under svn-control, any moving, deleting, renaming, should be done with svn commands (svn mv, svn rm, etc.), not using normal filesystem/file-explorer functions.

Wrikken
  • 69,272
  • 8
  • 97
  • 136
  • Yes I did copied and renamed. But all with svn commands and and with svn commit after each mayor change. But still things messed up. – Martin Aug 02 '10 at 16:59
  • Either _something_ did, or your svn implementation locally or on the server is broken. – Wrikken Aug 02 '10 at 17:20
  • I wonder if Eclipse messed things up. I do most Subversion related work on the command line. With the exceptions of package and class renaming which I do with Eclipse re-factoring. Of course Eclipse has the needed Subversion plug-in. – Martin Aug 03 '10 at 05:26
  • 2
    If there are (were) children, you may need '--depth infinity' or '--depth files' on the 'svn revert' command. – TextGeek Sep 17 '15 at 22:02
  • Use `svn revert -R /path/to/dir` when you want to restore a directory recursively. – Matthias Braun Feb 21 '18 at 09:41
  • 1
    in this aspect git is far better – ArmenB Nov 07 '18 at 23:42
  • Apparently, with current svn versions, you can just use `svn rm /path/to/file` without reverting first. – Fritz Jan 22 '19 at 16:06
  • I just did a commit and the exclamation mark was replaced by a green checkmark. – www.admiraalit.nl Jul 16 '20 at 10:11
23

What happens after you run:

svn cleanup .
svn update
svn status
Ether
  • 53,118
  • 13
  • 86
  • 159
  • and if you're worried about time recursing into other directories, add `--depth=files` to the update – Rup Aug 02 '10 at 16:24
  • The result is: >svn cleanup . >svn update svn: REPORT of '/svnroot/uiq3/!svn/vcc/default': Could not read chunk size: Secure connection truncated (https://uiq3.svn.sourceforge.net) Doesn't look good. I guess I have to bite the bullet and recreate the whole working tree… – Martin Aug 02 '10 at 17:04
3

I tried to revert & cleanup but it did not fix my issue. The solution I found is a bit harsh but worked:

  1. rename the old_folder to new_folder.
  2. from the parent issue a svn up old_folder
  3. copy back the files from the new_folder [avoiding coping the .svn folder from the new_folder].

the I deleted the new_folder and in this way I managed to have a cleaned old_folder.

dawez
  • 2,714
  • 2
  • 29
  • 50
  • 2
    Which is precisely what `Fix_Subversion.command` does. But I was asking for a faster / better solution. Besides: It might not work with Subversion 1.7 any more as Subversion 1.7 has only one .svn folder for the whole working copy. – Martin Jan 26 '12 at 15:04
  • 1
    This worked for me, on 1.6. I got the "!" after editing a file (didn't check it in) and then switching to a branch – Lost In Code Nov 06 '13 at 17:50
  • FixSubversion.command no longer exists, so we are stuck doing it this way now. – gbarry May 28 '19 at 05:26
1

What exactly did you do to the branch before you received this error?

If you're having regular problems with SVN, you're probably doing something wrong (e.g. using mv/rm as opposed to svn mv/svn rm on the branch).

Zaz
  • 46,476
  • 14
  • 84
  • 101
  • I copied a project to create a new similar one. I used «svn copy» to do so. I then committed the new project and started furher changes. – Martin Aug 02 '10 at 17:00
  • @Martin: So *all* you did was: `svn copy`, *make changes*, `svn commit`? If so, what were the changes? Did they involve moving, adding, or removing files? – Zaz Aug 02 '10 at 18:14
  • After the commit I started the “real” work. Re-factoring packages and so on. With the next check-in the trouble started. First an update was required (strange for a one man project). That update failed and it went downhill from there. But this was not really the question. I am used to grieve from Subversion and i just asked if there is a quick fix. I guess there is not so I checked out the whole tree again, copied my changes across and committed again. – Martin Aug 02 '10 at 18:25
1

If you deleted a file and it's marked with !, just run svn rm --force <filename> to tell SVN to delete the file from the repository also.

Justin
  • 655
  • 8
  • 17
  • 1
    svn status --no-ignore | grep -E '(^\!)|(^\!)' | sed -e 's/^. *//' | sed -e 's/\(.*\)/"\1"/' | xargs svn revert – HeikoG May 05 '20 at 17:34
1

In my case I have committed with a message the parent folder that has the red flag, and then all the nested folders that had the icon including the parent folder are cleared.

Balha
  • 17
  • 4