changeset 28869:f8182ab688a5

revset: narrow scope of "except ParseError" block in _parsealiasdecl() This helps to factor out a common function. "if True" will be removed soon.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 29 Feb 2016 17:43:39 +0900
parents 445a25bb70be
children 475dad3432fd
files mercurial/revset.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):