tags:

views:

52

answers:

2

I have my GWT project set up with hg for version control, and want to exclude the generated files in the war/modulename folder entirely.

I would prefer not to have to use an --exclude switch with every command. Is there a preferences file I can use to regularly exclude the directory?

+4  A: 

Use .hgignore file. Basically, you can create a .hgignore file in the directory or repo

Please look at the following SO discussion. It answers most of what you need.

The two different syntax in .hgignore file are glob and regexp. The SO posts and link to Mercurial documentation should make that clear.

A typical file can contain both types of syntax.

# use glob syntax.
syntax: glob

*.elc
*.pyc
*~

# switch to regexp syntax.
syntax: regexp
^\.pc/

As an example, the following ignores the files created during merge

syntax:regexp

\.orig$
\.orig\..*$
\.chg\..*$
\.rej$
\.conflict\~$
pyfunc
+1  A: 

To ignore a whole directory add the following to a .hgignore file in the root of your checkout:

war/modulename

If you just want a few files you could have a line something like so:

war/modulename/*.extension
Paul Rubel