Frage

In my .hgignore file, I am trying to ignore all generated xll files. I (unfortunately) have a directory called "xll" within the domain of the repository, and I do not want to ignore the directory itself.

I have tried:

syntax: regex
\.xll$

which I thought should mean "match all that ends in '.xll'" and

syntax: regex
*.\.xll$

which I thought should mean "match all that have at least one arbitrary character, followed by '.xll'".

With either of the above, the directory is not ignored (yay) but neither is a file foobar.xll (darn). If I use a bare "xll" with regex, or "*.xll" with glob, both the directory and the file are ignored.

This is in linux (Ubuntu 10.04.4) with hg 2.6 (TortoiseHG 2.8) (I'm observing the effect in Nautilus via the presence or absence of "X" icons).

Thanks in advance!

EDIT (adding comments in here as they are too long to fit in a comment...) Thanks for all the responses. Turns out I was misinterpreting some things. So: - because I used "regex" instead of "regexp" (and I had "glob" at top of file), whatever I put on the line that referred to "xll" was being interpreted by "glob", so the line did have an effect (which made me think, incorrectly, that the "syntax: regex" line was doing what I thought it was - by coincidence, all the files in my "xll" directory were filtered out (as they should have been) by other lines in .hgignore, and not by the "*.xll" line - consequently, in Nautilus, the xll directory was marked as "ignored", not because the filter ignoring the entire directory, but instead because other filters were filtering all files within that directory

Bottom line, the *.xll I had under "syntax: glob" was actually filtering out files exactly as desired. The feedback in Nautilus was just different than I expected.

War es hilfreich?

Lösung 2

Using glob syntax works well for me:

syntax: glob
*.xll

When I create a directory named xll with an untracked file, I still see the file in the output from hg status:

$ mkdir xll
$ touch a.xll x.txt xll/b.xll xll/y.txt
$ echo 'syntax: glob\n*.xll' > .hgignore
$ hg status
? .hgignore
? x.txt
? xll/y.txt

Using \.xll$ with syntax: regexp also works great for me.

Andere Tipps

It's .*\.xll$, not *.\.xll$.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top