diff --exclude format

Matthew Watson mattw.watson at gmail.com
Wed Jun 2 21:48:33 CDT 2010


Hi Guys,

I'm trying to write and extension and I'm calling commands.diff and
I'm passing a --exclude option. I'm trying to figure out from the doco
what the format of this "pattern" is: Seems to variously take shell
type globs or regexps with varying results.

OK, so I can't find doco really, so I looked through the source. Seems
the best way is to specify what it is by saying:

--exclude "re:regexp"
or
--exclude "glob:shellglob"

Is the only doco for this to be got by reading _patsplit in mercurial/match.py??

FYI: I' trying to cope with weird file names that may have regex/glob
shars in them, so was calling re.escape(path), but this produce
"\.hgignore" for input of ".hgignore" which isn't good on windows
because the glob format thinks this is a path separator (works fine on
mac though). Finally figured out I should prepend "re:" and treat the
whole as a regexp.

Matt


More information about the Mercurial-devel mailing list