[PATCH] revset: rename getkwargs() to getargsdict()

Yuya Nishihara yuya at tcha.org
Thu Jul 9 09:43:34 CDT 2015

# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1435840771 -32400
#      Thu Jul 02 21:39:31 2015 +0900
# Node ID befe8a7138c8bf6c6383a31065339804390ff136
# Parent  648323f41a89619d9eeeb7287213378c340866c8
revset: rename getkwargs() to getargsdict()

This function was added recently at 48919d246a47, but its name was misleading
because it processes both positional and keyword arguments.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -282,7 +282,7 @@ def getargs(x, min, max, err):
         raise error.ParseError(err)
     return l
-def getkwargs(x, funcname, keys):
+def getargsdict(x, funcname, keys):
     return parser.buildargsdict(getlist(x), funcname, keys.split(),
                                 keyvaluenode='keyvalue', keynode='symbol')
@@ -840,7 +840,7 @@ def extra(repo, subset, x):
     a regular expression. To match a value that actually starts with `re:`,
     use the prefix `literal:`.
-    args = getkwargs(x, 'extra', 'label value')
+    args = getargsdict(x, 'extra', 'label value')
     if 'label' not in args:
         # i18n: "extra" is a keyword
         raise error.ParseError(_('extra takes at least 1 argument'))

More information about the Mercurial-devel mailing list