windows - Mercurial 中不区分大小写的文件名处理

标签 windows mercurial tortoisehg

我在 Vista64 上使用 TortoiseHg 0.5(包括 Mercurial 1.0.2)。我的理解来自Mercurial Book是 Mercurial 应该在不区分大小写的文件系统(例如 NTFS,我正在使用的文件系统)上以不区分大小写的方式处理文件名。但是我发现我安装的 Mercurial 实际上对大小写敏感:

>hg status -A foo
C foo
>hg status -A FOO
? FOO

这可能是 Mercurial 中的错误、Mercurial 的 TortoiseHg 构建中的错误,还是其他原因?如何在 Windows 上从 Mercurial 实现不区分大小写的文件名处理?

最佳答案

此问题已在 Mercurial 1.1 中得到解决!来自release notes :“改进了面对 casefolding 文件系统的正确性”。

在 Windows 上,Mercurial 现在忽略其命令行参数中的大小写:

>hg status -A foo
C foo
>hg status -A FOO
C foo

并且它还知道只涉及大小写的文件名更改不是新文件:

>ren foo FOO
>hg status -A fOO
C foo

因此,不再存在因命令行输入错误而忽略更改的风险。

但是,请注意 .hgignore 文件的内容仍然区分大小写。只有在使用 glob 语法时才会出现此问题;使用正则表达式语法,您可以将 (?i) 放在模式的开头以使其不敏感。

关于windows - Mercurial 中不区分大小写的文件名处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/238608/

相关文章:

python - 无法在 Windows : fatal error C1083: Cannot open include file: 'io.h' : No such file or directory error: 中安装 pycocotools

mercurial - HG : Checkout 'tipmost' tag

mercurial - 在 Mercurial : how does one bring two independent svn clones back together? 中重新养育

mercurial - 如何在 Mercurial 中回滚分支 merge

mercurial - 如何使用草龟hg "that are part of the repository"忽略窑炉/ Mercurial 中的文件

r - 在Windows上将英特尔的数学内核库(MKL)链接到R

c/windows : opening all . 目录中的 txt 文件

python - PyQt 应用程序在 Linux 上卡住屏幕,在 Windows 上正常

git - merge 两个分支而不实际 merge

mercurial - 您可以在 64 位 Windows 7 上使用 Mercurial 进行 'push' 网络共享吗?