Patchwork [3,of,6,sethelp,v2] revset: use UnknownIdentifier where appropriate

login
register
mail settings
Submitter Augie Fackler
Date March 6, 2015, 11:01 p.m.
Message ID <6f82cc057e0175b41fdb.1425682904@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/7914/
State Accepted
Commit 282c0d8c188013deb33258051d6197398582fbce
Headers show

Comments

Augie Fackler - March 6, 2015, 11:01 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1422300750 18000
#      Mon Jan 26 14:32:30 2015 -0500
# Node ID 6f82cc057e0175b41fdb3669c471132c4c58b077
# Parent  0c7f94a49b2fd024e54524f12a02b9b59feb304e
revset: use UnknownIdentifier where appropriate

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -368,7 +368,7 @@  def listset(repo, subset, a, b):
 def func(repo, subset, a, b):
     if a[0] == 'symbol' and a[1] in symbols:
         return symbols[a[1]](repo, subset, b)
-    raise error.ParseError(_("not a function: %s") % a[1])
+    raise error.UnknownIdentifier(a[1], symbols.keys())
 
 # functions
 
@@ -2151,7 +2151,7 @@  def _checkaliasarg(tree, known=None):
     if isinstance(tree, tuple):
         arg = _getaliasarg(tree)
         if arg is not None and (not known or arg not in known):
-            raise error.ParseError(_("not a function: %s") % '_aliasarg')
+            raise error.UnknownIdentifier('_aliasarg', [])
         for t in tree:
             _checkaliasarg(t, known)