问题描述
注意:我尝试了此处列出的所有可能性:我如何忽略在Mercurial文件夹中的所有内容.
没有一个能如我所愿.
Caveat:I try all the posibilities listed here: How can I ignore everything under a folder in Mercurial.
None works as I hope.
我想忽略文件夹test
下的所有内容.但不要忽略srcProject\test\TestManager
I want to ignore every thing under the folder test
. But not ignore srcProject\test\TestManager
我尝试
syntax: glob
test/**
它会忽略test
和srcProject\test\TestManager
使用:
syntax: regexp
^/test/
是同一回事.
也:
syntax: regexp
test\\*
我已经在Windows中安装了带有Mercurial-626cb86a6523 + tortoisehg,Python-2.5.1,PyGTK-2.10.6,GTK-2.10.11的TortoiseHG 0.4rc2
I have install TortoiseHG 0.4rc2 with Mercurial-626cb86a6523+tortoisehg, Python-2.5.1, PyGTK-2.10.6, GTK-2.10.11 in Windows
推荐答案
在正则表达式版本中,在尖号后尝试不加斜杠.
Try it without the slash after the caret in the regexp version.
^test/
这是一个测试:
~$ mkdir hg-folder-ignore
~$ cd hg-folder-ignore
~/hg-folder-ignore$ echo '^test/' > .hgignore
~/hg-folder-ignore$ hg init
~/hg-folder-ignore$ mkdir test
~/hg-folder-ignore$ touch test/ignoreme
~/hg-folder-ignore$ mkdir -p srcProject/test/TestManager
~/hg-folder-ignore$ touch srcProject/test/TestManager/dont-ignore
~/hg-folder-ignore$ hg stat
? .hgignore
? srcProject/test/TestManager/dont-ignore
请注意,忽略我没有出现,不要忽略它.
Notice that ignoreme isn't showing up and dont-ignore is.
这篇关于忽略文件夹中的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!