Imagine a directory structure like this...
Data is a directory that stores the data for your project while running, so you want to ignore it. Opening up your .hgignore file you've had for awhile, you see something like this...
...and you decide to do this...
This is a bad move. Sooner or later, your project is going to look like this...
| |-- stuff.py
| `-- stuff2.py
`-- data <-- !!!
And suddenly, when you make that src/parts/data directory, it's going to be ignored by Mercurial. If you want to ignore a specific directory, such as one that is used for data (common when using pylons), it's better to use:
This will ignore any file or directory in your entire repository that goes by the name "data". Note that this is the name relative to the project's root, so our data file in the src directory would not be matched since it's name is 'src/parts/data'. The ^ and $ are used in regular expressions to signify the start and end of the string.