开发者

Hgignore everything except, regardless of directory

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 wh开发者_开发技巧at 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


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.

syntax: regexp
(?<!\.cfm)$

assuming that what you were trying to do is ignore everything except .cfm files. Example:

% hg stat --all
A .hgignore
I adir/file.cfm

In general, don't overcomplicate the regex lines -- if you're (un)ignoring two different categories of things use two lines.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜