Hgignore 除目录之外的所有内容
我已经看过 hgignore 的帖子,除了,但我似乎无法将正则表达式转换为与子目录一起使用。
syntax: regexp
(?<!\.cfm)$
适用于根目录,但不适用于子目录/子子目录。我不想手动指定这些。
这是我没有忽略时看到的:
>hg stat
? document.cfm
? document.txt
? subdir1\document.cfm
? subdir1\document.txt
? subdir1\subsubdir1\document.cfm
? subdir1\subsubdir1\document.txt
? subdir2\document.cfm
? subdir2\document.txt
这是我有忽略时看到的:
>hg stat
M .hgignore
? document.cfm
这是我想要看到的:
>hg stat
? document.cfm
? subdir1\document.cfm
? subdir1\subsubdir1\document.cfm
? subdir2\document.cfm
I've seen the posts for hgignore everything except, but I can't seem to transform the regex to work with subdirectories as well.
syntax: regexp
(?<!\.cfm)$
Works for the root directory but not subdirs/subsubdirs. I don't want to manually specify those.
This is what I see without the ignore:
>hg stat
? document.cfm
? document.txt
? subdir1\document.cfm
? subdir1\document.txt
? subdir1\subsubdir1\document.cfm
? subdir1\subsubdir1\document.txt
? subdir2\document.cfm
? subdir2\document.txt
This is what I see with the ignore:
>hg stat
M .hgignore
? document.cfm
This is what I want to see:
>hg stat
? document.cfm
? subdir1\document.cfm
? subdir1\subsubdir1\document.cfm
? subdir2\document.cfm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加文件会覆盖忽略,因此对于 .hgignore,如果您已经添加了它,则无需担心包含它。这使得这变得容易得多。
假设您尝试执行的操作是忽略除
.cfm
文件之外的所有内容。示例:一般来说,不要使正则表达式行过于复杂 - 如果您(不)忽略两个不同类别的事物,请使用两行。
Adding a file overrides ignores, so for the .hgignore if you've already added it you don't need to worry about including it. That makes this much easier.
assuming that what you were trying to do is ignore everything except
.cfm
files. Example:In general, don't overcomplicate the regex lines -- if you're (un)ignoring two different categories of things use two lines.
想要的行动是不可能的。 Python 只进行固定宽度的负查找。结束这个问题。感谢任何研究过它的人。
The desired action is impossible. Python only does fixed-width negative lookups. Closing this question. Thanks to anyone who looked into it.