# HG changeset patch # User Yuya Nishihara # Date 1456735419 -32400 # Node ID f8182ab688a5b86ca2a469ed345adb0bec1d9864 # Parent 445a25bb70be6a748c3eef2d5cc09d53bb65f79e revset: narrow scope of "except ParseError" block in _parsealiasdecl() This helps to factor out a common function. "if True" will be removed soon. diff -r 445a25bb70be -r f8182ab688a5 mercurial/revset.py --- a/mercurial/revset.py Tue Apr 12 04:06:50 2016 -0700 +++ b/mercurial/revset.py Mon Feb 29 17:43:39 2016 +0900 @@ -2279,7 +2279,10 @@ if (pos != len(decl)): raise error.ParseError(_('invalid token'), pos) tree = parser.simplifyinfixops(tree, ('list',)) - + except error.ParseError as inst: + return (decl, None, None, parser.parseerrordetail(inst)) + + if True: # XXX to be removed if tree[0] == 'symbol': # "name = ...." style name = tree[1] @@ -2303,8 +2306,6 @@ return (name, tree[:2], args, None) return (decl, None, None, _("invalid format")) - except error.ParseError as inst: - return (decl, None, None, parser.parseerrordetail(inst)) def _relabelaliasargs(tree, args): if not isinstance(tree, tuple):