regex - .hgignore syntax for ignoring only files, not directories? -
I have a problem that I can not understand. I am using TortoiseHg (version 0.7.5) on Windows, but I have the same problem on Linux. Here it is:
My .hgignore
file:
syntax: regexp ^ [^ \\ /] + $
< / Pre>What I am trying to achieve is to add files that are in the root of the HG repository, to the ignore list. For example if I like this:
.hg + mydir1 + mydir2 -myfile1 -myfile2 -otherfile1 -otherfile2 .hgignore
let me myfile1 (2 ) And other file 1 (2) should be ignored (names are for the purpose of this example only - they do not have a simple rule which can easily be inserted in the hgignore file)
Something is missing because I'm pretty sure that the regexp is good (I also test it)? idea?
Is there an easy way to get this? [Rare lists to add files which are in the root of the Mercurial repository]
I relayed it irc In the question on .freenode.net #mersial
and the response was that you can not differentiate between files and directories - the directory is mailed without slash which you are searching in your regexp.
However, if you can assume that your directory has full-stop
will not be, but if you have files, then something like this seems to be done:
^ [^ /] * \ .. * $
I like it Tested in a repository:
% hg Status -ui? A.txt? BBB? Foo / x.txt? BBB? Foo / x.txt? Foo / yyy I .hgignore i a.txt
indicates that the a.txt
file is properly ignored in your root directory, but X.txt
foo
is not in the subdirectory. You can also see that in the root code not a file named bbb
But you may be able to add such a file yourself to the .hgignore
file.
If you have a directory like bar.baz
in your directory, then this directory and all files will be ignored. I hope this helps a bit.
Comments
Post a Comment