revset: narrow scope of "except ParseError" block in _parsealiasdecl()
This helps to factor out a common function. "if True" will be removed soon.
--- 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):