Patchwork [5,of,9,sethelp] revset: use NotAFunction where appropriate

login
register
mail settings
Submitter Augie Fackler
Date Feb. 4, 2015, 6:15 p.m.
Message ID <232bd67d5c1350c85e9f.1423073710@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/7667/
State Changes Requested
Headers show

Comments

Augie Fackler - Feb. 4, 2015, 6:15 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1422300750 18000
#      Mon Jan 26 14:32:30 2015 -0500
# Node ID 232bd67d5c1350c85e9f787e1f3be62a02bb7872
# Parent  e4a95908b4efb5c23d17ec4ac449399708fd120d
revset: use NotAFunction where appropriate

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -370,7 +370,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.NotAFunction(a[1], symbols.keys())
 
 # functions
 
@@ -2152,7 +2152,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.NotAFunction('_aliasarg', [])
         for t in tree:
             _checkaliasarg(t, known)