简体   繁体   English

如何使hg忽略过滤器不区分大小写

[英]How to make hg ignore filter case insensitive

I am trying to set up an hg repo for an old project on Windows. 我正在尝试为Windows上的旧项目设置hg repo。 I want to ignore images, binaries, and some 3rd party source files, however these files contains different casing for the same patterns, for example, .jpg and .JPG, abc_sth and ABC_sth. 我想忽略图像,二进制文件和一些第三方源文件,但是这些文件包含相同模式的不同大小写,例如.jpg和.JPG,abc_sth和ABC_sth。

I learned that hgignore is case sensitive, do I have to list the different cases all in the hgignore file, or are there options that I can turn on to make the ignore filter case insensitive? 我了解到hgignore区分大小写,我是否必须在hgignore文件中列出所有不同的案例,或者是否有可以打开的选项以使忽略过滤器不区分大小写?

Finally I get enough rep to post my own answer. 最后,我得到足够的代表发布我自己的答案。

Use regex syntax, and prefix (?i) . 使用正则表达式语法和前缀(?i) So the pattern for the example I used here can be 所以我在这里使用的例子的模式可以是

syntax: regexp
(?i)\.jpg
(?i)abc_

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM