2 Answers
2

The easiest way to make a glob pattern match dot files is to use the Dglob qualifier.

**/*(D)

The precedence of ~ is lower than /, so **~.hg/* is ** minus the matches for .hg/*. But ** is only special if it's before a /, so here it matches the files in the current directory. To exclude .hg and its contents, you need

**/*~.hg~.hg/*(D)

Note that zsh will still traverse the .hg directory, which can take some time; this is a limitation of **: you can't set an exclusion list directly at this level.