I use Xcode Repositories for working with svn, and today i added a new version to my Core Data Model and tried to commit it. But Xcode through an error:
svn: Commit failed (details follow):
svn: Entry for '/Users/user/Desktop/project/Core Data/Translator.xcdatamodeld/Translator 2.0.xcdatamodel/contents' is marked as 'copied' but is not itself scheduled
for addition. Perhaps you're committing a target that is
inside an unversioned (or not-yet-versioned) directory?
I think that the problem is that svn treates xcdatamodel as a dolder, and since it is changed it doesn's under version control anymore. But what should i do then? Don't commit new models and transfer it manually?)
I would recommend writing a subversion checkout/commit hook that would create a zip or tar archive of the Translator.xcdatamodeld directory, and then check that in. The actual xcdatamodeld directory would be ignored. (It would probably be best not to compress the archive, since compressing will just make it harder for svn to compute diffs and make your repository larger.)
The problem is that when you start with the first data model, Xcode creates a file, let's say: myProject.xcdatamodeld
Let's say that you create, via menu Editor > Add Model Version , a second version of the model named _myProject_v2_. What Xcode actually does is: it creates a folder, named as your original model, and copies the original model in a subfolder, then creates a second subfolder with a file containing the new version:
myProject.xcdatamodeld
|
+- myProject.xcdatamodel
| |
| +- contents (a file containing the actual model)
|
+- myProject_v2.xcdatamodel
|
+- contents (a file containing the 2nd version of the model)
So SVN gets confused, because what he thinks is a file (the original myProject.xcdatamodeld) and which is stored in SVN, is now a folder, with subfolders. And moreover, these subfolders, being created by XCode, gets eventually their hidden .svn folder.. so my solution is:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.