2

I'm trying to get mercurial to ignore diffs. I performed the following according to Mercurial ignore file:

$ echo "*.diff" >> .hgignore

Status now give me an error (I added the '...' for readability):

$ hg status
abort: .../.hgignore: invalid pattern (relre): *.diff

Searching the web for the error message returned a few non-relevant results. Any ideas on how to ignore diff files?

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885

1 Answers1

5

Write first: syntax: glob

Fully .hgignore

syntax: glob

*.diff

The default regex. You can write all the regular expression, then switch to syntax glob. Example:

\.pyc$
test\.py$

syntax: glob
*.diff

If you want to exclude all but a few, it is better to use a regular expression.

crazyzubr
  • 1,072
  • 7
  • 14
  • Thanks crazyzubr. How do I turn off globbing after the `*.diff` entry? – jww Dec 13 '13 at 15:27
  • If you only want one line to use glob you can use glob:*.diff otherwise you can switch to regex using, on a single line, syntax: regexp – neilh Dec 13 '13 at 15:29