问题
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