We are using Mercurial for keeping track of a number of linguistic papers. We want to keep our source files in Mercurial. The source files are mostly in XML, but the output file is in PDF. Therefore, we have added glob:*.pdf
to our .hgignore file. Among our source files, we also have graphic files with extensions like .jpg, .png, and .svg. Recently, we've also added .pdf files as graphic files. Naturally, these PDF graphic files are not showing up when we do a hg status
command.
So my question is this: is there a way to create a .hgignore pattern that will ignore *.pdf files in most directories but still show *.pdf in specified directories (directories where we store our graphic files)?
There's a good example which does nearly what you want in the Mercurial wiki.
Quote from the link:
If the number of directories where you want to ignore PDF files is somewhat limited (and not: "ignore
*.pdf
in all directories but this one"), you can use this solution.