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?

Riley Lark
  • 20,660
  • 15
  • 80
  • 128

3 Answers3

7

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\~$
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
pyfunc
  • 65,343
  • 15
  • 148
  • 136
4

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
Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
Paul Rubel
  • 26,632
  • 7
  • 60
  • 80
0

In your SourceFolder .hgignore use the following:

The solution, for folders named gen and bin and a file named .classpath:

syntax: regexp  
^SourceFolder\bin  
^SourceFolder\gen  
^SourceFolder\.classpath
JaKXz
  • 1,665
  • 1
  • 14
  • 34