comparison mercurial/minifileset.py @ 35800:d5288b966e2f stable

minifileset: note the unsupported file pattern when raising a parse error This was useful in debugging, because I stupidly quoted it out of habit from the command line. This isn't a great example that clearly shows the problem, but I don't know how to improve it. The problem *is* obvious once a complex statement or a clearly bogus string is used.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 24 Jan 2018 22:26:28 -0500
parents 73432eee0ac4
children 9c98cb30f4de
comparison
equal deleted inserted replaced
35799:b91bca85ba73 35800:d5288b966e2f
28 elif name.startswith('path:'): # directory or full path test 28 elif name.startswith('path:'): # directory or full path test
29 p = name[5:] # prefix 29 p = name[5:] # prefix
30 pl = len(p) 30 pl = len(p)
31 f = lambda n, s: n.startswith(p) and (len(n) == pl or n[pl] == '/') 31 f = lambda n, s: n.startswith(p) and (len(n) == pl or n[pl] == '/')
32 return f 32 return f
33 raise error.ParseError(_("unsupported file pattern"), 33 raise error.ParseError(_("unsupported file pattern: %s") % name,
34 hint=_('paths must be prefixed with "path:"')) 34 hint=_('paths must be prefixed with "path:"'))
35 elif op == 'or': 35 elif op == 'or':
36 func1 = _compile(tree[1]) 36 func1 = _compile(tree[1])
37 func2 = _compile(tree[2]) 37 func2 = _compile(tree[2])
38 return lambda n, s: func1(n, s) or func2(n, s) 38 return lambda n, s: func1(n, s) or func2(n, s)