Recently my repository has become too large, so I want to ignore some of the folders within the project so that I don't take up so much space. I know how to ignore individual files, but when I ignore a folder, it doesn't do anything. I can go through each individual file and ignore those, but that would be way too tedious, as it forces you to add them one at a time. Any ideas?
I use the glob syntax, which enables me to just use the folder name directly to ignore it. I put a slash and a wildcard after the folder name in the hopes it then only ignores folders with that name and not individual files that happen to have that same name, but I don't actually know if that works (I haven't yet had any files with same names as my folders). To illustrate:
syntax: glob
obj/*
Now folder named "obj" gets ignored. Just a line "obj" instead of "obj/*" would work as well, but also ignore any files named "obj".
By default, hg uses regular expression patterns when parsing the ignore file. The "syntax: glob" changes the expected syntax for all lines after that line, until syntax is changed again with "syntax: regexp". I just put "syntax: glob" as the first line of my .hgignore and use that for the whole file.
For the regexp syntax, I suspect the pattern for ignoring folders is different. If you want to use the regexp syntax,
this page from the Mercurial wiki might help you.