Why svn import option fails to detect file duplication

﹥>﹥吖頭↗ 提交于 2019-12-12 17:38:03

问题


If I want to check-in a file with same name which is already present in SVN, I would not be able to commit in that case. For example: Name.doc and name.doc. But, I will be able to import in that case.

This case even applicable for folder name. This prevents the operation of check-out in future.

Is there a way to prevent file or folder duplication? or it is not possible in SVN?


回答1:


Subversion is case sensitive. Meaning it is perfectly fine to have multiple items with the same name, e.g. Name.doc, name.doc, NaMe.DOC, ...

TortoiseSVN corrects such filenames automatically in the commit dialog, because there it can check against the working copy BASE and look for files with the same name. Other SVN clients don't do that, so it's not the commit that prevents this but TortoiseSVN.

However when you do an import, you don't have a working copy against which the filenames can be compared to - and the repository doesn't care. So the import will lead to multiple items with the same name.

If you want to prevent this from happening, you can install a pre-commit hook script on the repository. Subversion provides such a hook script: https://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/case-insensitive.py



来源:https://stackoverflow.com/questions/5393395/why-svn-import-option-fails-to-detect-file-duplication

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!