[英]Core Data versioning and SVN
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. 我使用Xcode Repositories来处理svn,今天我向核心数据模型添加了一个新版本,并尝试提交它。 But Xcode through an error: 但是Xcode通过一个错误:
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. 我认为问题在于svn将xcdatamodel视为dolder,并且由于更改了它,因此不再受版本控制。 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. 我建议编写一个Subversion签出/提交钩子,该钩子将创建Translator.xcdatamodeld目录的zip或tar存档,然后将其检入。实际的xcdatamodeld目录将被忽略。 (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.) (最好不要压缩档案,因为压缩只会使svn更加难于计算差异并使存储库更大。)
The problem is that when you start with the first data model, Xcode creates a file, let's say: myProject.xcdatamodeld 问题是,当您从第一个数据模型开始时,Xcode会创建一个文件,例如:myProject.xcdatamodeld
Let's say that you create, via menu Editor > Add Model Version , a second version of the model named _myProject_v2_. 假设您通过菜单编辑器>添加模型版本创建名为_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: Xcode的实际作用是:创建一个名为您的原始模型的文件夹,然后将原始模型复制到一个子文件夹中,然后使用包含新版本的文件创建另一个子文件夹:
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. SVN感到困惑,因为他认为是一个文件(原始myProject.xcdatamodeld)并存储在SVN中,现在它是一个带有子文件夹的文件夹。 And moreover, these subfolders, being created by XCode, gets eventually their hidden .svn folder.. so my solution is: 而且,这些由XCode创建的子文件夹最终会获得其隐藏的.svn文件夹..因此,我的解决方案是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.