Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/minifileset.py Thu Jan 04 14:20:58 2018 +0900 +++ b/mercurial/minifileset.py Sat Jan 13 15:07:37 2018 +0900 @@ -56,9 +56,8 @@ 'size': lambda n, s: fileset.sizematcher(tree[2])(s), } - x = tree[1] - name = x[1] - if x[0] == 'symbol' and name in symbols: + name = fileset.getsymbol(tree[1]) + if name in symbols: return symbols[name] raise error.UnknownIdentifier(name, symbols.keys())