Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove properly a file on xcode 4 with svn version control

Tags:

svn

xcode4

When I remove a file or a folder with the finder from my projet on svn version control I always got a warning:

file://localhost/Users/XXX/Documents/Projets/XXX/file.jpg: warning: Missing file: /Users/XXX/Documents/Projets/XXX/file.jpg is missing from working copy

How to delete the file properly ? This file is not showed on the project navigator.

Thanks.

like image 378
Benoît Freslon Avatar asked May 05 '11 11:05

Benoît Freslon


3 Answers

The other answer is needlessly complicated and involves removing all of the source control bindings from your working folder - when there is a simple fix available.

This behavior usually occurs when you move a file in Finder or delete a file in Finder and then later hit "delete" on the missing reference in Xcode.

This happens because Xcode automatically "adds" the file to SVN - so now that the file is no longer there, SVN is confused because it thinks it should be there - and when you deleted the file in Finder your SVN info didn't get updated (you didn't delete the file in SVN).

The warning isn't an Xcode warning per-se - but more of a general source control / SVN warning.

To fix the warning (and the state of your local SVN working folder) either use your SVN client to "revert" the prior "add" operation:

svn revert PATH

or, less preferably, you can force "Delete" the missing file:

svn delete --force PATH

To prevent the error from occurring in the first place, always "Delete" through Xcode, or, through your SVN client (but, if you delete it through your SVN client you'll still have to delete the missing reference in Xcode - so you might as well just delete it in Xcode to being with).

like image 55
Steve Avatar answered Sep 28 '22 18:09

Steve


had the same issue, and I just solved it by:

  1. delete the repository in Xcode's Organizer
  2. quit Xcode
  3. delete all .svn hidden folders (also within the *.xcodeproj file)

Hope this works for you as well.

like image 34
nicc Avatar answered Sep 28 '22 19:09

nicc


I experienced the same issue after deleting file from folder, then reference from XCode project.

I solved it by committing to SVN, then updating the Working Copy again from the SVN.

like image 35
Armand Smit Avatar answered Sep 28 '22 19:09

Armand Smit