2

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

Habby
  • 21
  • 3
  • Check this post out, it should help you achieve what you are trying to do: basically you gonna need to use Regex, http://stackoverflow.com/questions/1512058/hgignore-help-ignoring-all-files-but-certain-ones – Bassam Mehanni Jan 30 '12 at 17:05

1 Answers1

2

There's a good example which does nearly what you want in the Mercurial wiki.

Quote from the link:

/target/.*\.o$

This would match all files ending with .o below (within and in subdirectories at any depth of) the target directory.

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.

Christian Specht
  • 35,843
  • 15
  • 128
  • 182