diff -r 9d28fd795215 -r 03782d2fc776 mercurial/match.py --- a/mercurial/match.py Thu Oct 03 18:01:21 2013 +0200 +++ b/mercurial/match.py Sun Apr 13 22:00:08 2014 +0200 @@ -228,7 +228,21 @@ return default, pattern def _globre(pat): - '''Convert an extended glob string to a regexp string.''' + r'''Convert an extended glob string to a regexp string. + + >>> print _globre(r'?') + . + >>> print _globre(r'*') + [^/]* + >>> print _globre(r'**') + .* + >>> print _globre(r'[a*?!^][^b][!c]') + [a*?!^][\^b][^c] + >>> print _globre(r'{a,b}') + (?:a|b) + >>> print _globre(r'.\*\?') + \.\*\? + ''' i, n = 0, len(pat) res = '' group = 0