忽略目录以外的所有内容 [英] Hgignore everything except, regardless of directory

查看:78
本文介绍了忽略目录以外的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了hgignore以外,我都看过这些帖子,但我似乎无法将正则表达式转换为也可以与子目录一起使用.

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)$

适用于根目录,但不适用于subdirs/subsubdirs.我不想手动指定这些.

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

这是我使用忽略的内容:

>hg stat
M .hgignore
? document.cfm

这是我想要看到的内容:

>hg stat
? document.cfm
? subdir1\document.cfm
? subdir1\subsubdir1\document.cfm
? subdir2\document.cfm

推荐答案

所需的操作是不可能的. Python仅执行固定宽度的否定查找.结束这个问题.感谢任何研究它的人.

The desired action is impossible. Python only does fixed-width negative lookups. Closing this question. Thanks to anyone who looked into it.

这篇关于忽略目录以外的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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