I have in my .hgignore the pattern "*.pyc"
The .pyc files are indeed ignored at the root level, but not inside subdirectories.
Any ideas?
By default, the patterns are python regular expressions. The expressions are searched in every component of the path. So you probably want \.pyc$
to match files ending with .pyc
$ hg init test-ignore
$ cd test-ignore
$ touch foo.pyc
$ mkdir bar
$ touch bar/bar.pyc
$ echo "\.pyc$" > .hgignore
$ hg st
? .hgignore
Note that ".pyc$" will ignore "foopyc" as the unescaped dot matches any character. Similarly ".pyc" would match "foo.pyche.bar"
If you dislike the regular expression syntax, you can switch to globals. For instance, the current .hgignore in Mercurial's repository starts with:
syntax: glob
*.elc
*.orig
*.rej
*~
*.mergebackup
*.o
*.so
*.pyd
*.pyc
*.swp
*.prof
\#*\#
.\#*
Everything is explained in man 5 hgignore
Use glob
syntax (put syntax: glob
at the top of the file), and it should work. Mercurial defaults to regular expressions by default.
syntax: glob
*.pyc
you can try to use this code
syntax:glob
**.pyc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With