Mercurial > hg
comparison mercurial/minifileset.py @ 35691:735f47b41521
fileset: make it robust for bad function calls
Before, it could crash or show cryptic message.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 13 Jan 2018 15:07:37 +0900 |
parents | 706aa203b396 |
children | 06a757b9e334 |
comparison
equal
deleted
inserted
replaced
35690:3e394e0558d7 | 35691:735f47b41521 |
---|---|
54 'all': lambda n, s: True, | 54 'all': lambda n, s: True, |
55 'none': lambda n, s: False, | 55 'none': lambda n, s: False, |
56 'size': lambda n, s: fileset.sizematcher(tree[2])(s), | 56 'size': lambda n, s: fileset.sizematcher(tree[2])(s), |
57 } | 57 } |
58 | 58 |
59 x = tree[1] | 59 name = fileset.getsymbol(tree[1]) |
60 name = x[1] | 60 if name in symbols: |
61 if x[0] == 'symbol' and name in symbols: | |
62 return symbols[name] | 61 return symbols[name] |
63 | 62 |
64 raise error.UnknownIdentifier(name, symbols.keys()) | 63 raise error.UnknownIdentifier(name, symbols.keys()) |
65 elif op == 'minus': # equivalent to 'x and not y' | 64 elif op == 'minus': # equivalent to 'x and not y' |
66 func1 = _compile(tree[1]) | 65 func1 = _compile(tree[1]) |