Patchwork [5,of,5] revsetlang: remove unused functions

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 31, 2017, 2:42 p.m.
Message ID <167fea06d67ff144461c.1504190534@mimosa>
Download mbox | patch
Permalink /patch/23538/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 31, 2017, 2:42 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1503147843 -32400
#      Sat Aug 19 22:04:03 2017 +0900
# Node ID 167fea06d67ff144461c38799ba8cecaaddd0228
# Parent  67ed9cb475e3b952572b9bc46e2ed56f0474f381
revsetlang: remove unused functions

Superseded by the _match() function.
Augie Fackler - Sept. 1, 2017, 7:21 p.m.
On Thu, Aug 31, 2017 at 11:42:14PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1503147843 -32400
> #      Sat Aug 19 22:04:03 2017 +0900
> # Node ID 167fea06d67ff144461c38799ba8cecaaddd0228
> # Parent  67ed9cb475e3b952572b9bc46e2ed56f0474f381
> revsetlang: remove unused functions

queued, thanks

Patch

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -270,25 +270,6 @@  def _match(patspec, tree):
     return parser.matchtree(pattern, tree, ('symbol', '_'),
                             {'keyvalue', 'list'})
 
-def _isnamedfunc(x, funcname):
-    """Check if given tree matches named function"""
-    return x and x[0] == 'func' and getsymbol(x[1]) == funcname
-
-def _isposargs(x, n):
-    """Check if given tree is n-length list of positional arguments"""
-    l = getlist(x)
-    return len(l) == n and all(y and y[0] != 'keyvalue' for y in l)
-
-def _matchnamedfunc(x, funcname):
-    """Return args tree if given tree matches named function; otherwise None
-
-    This can't be used for testing a nullary function since its args tree
-    is also None. Use _isnamedfunc() instead.
-    """
-    if not _isnamedfunc(x, funcname):
-        return
-    return x[2]
-
 def _matchonly(revs, bases):
     return _match('ancestors(_) and not ancestors(_)', ('and', revs, bases))