为什么 svn 导入选项无法检测文件重复 [英] Why svn import option fails to detect file duplication

查看:33
本文介绍了为什么 svn 导入选项无法检测文件重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想签入一个已存在于 SVN 中的同名文件,在这种情况下我将无法提交.例如:Name.docname.doc.但是,在这种情况下,我将能够导入.

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.

有没有办法防止文件或文件夹重复?或者在 SVN 中是不可能的?

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

推荐答案

Subversion 区分大小写.这意味着拥有多个具有相同名称的项目是完全没问题的,例如Name.doc, name.doc, NaMe.DOC, ...

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 会在提交对话框中自动更正此类文件名,因为它可以在那里检查工作副本 BASE 并查找具有相同名称的文件.其他 SVN 客户端不会这样做,因此阻止此操作的不是提交而是 TortoiseSVN.

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.

如果你想防止这种情况发生,你可以在存储库上安装一个预提交钩子脚本.Subversion 提供了这样一个钩子脚本:https://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/case-insensitive.py

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

这篇关于为什么 svn 导入选项无法检测文件重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆