##// END OF EJS Templates
revset: remove redundant checks for parsed tree of alias...
Yuya Nishihara -
r28705:0e414895 default
parent child Browse files
Show More
@@ -335,7 +335,7 b' def getargsdict(x, funcname, keys):'
335 335 def isvalidsymbol(tree):
336 336 """Examine whether specified ``tree`` is valid ``symbol`` or not
337 337 """
338 return tree[0] == 'symbol' and len(tree) > 1
338 return tree[0] == 'symbol'
339 339
340 340 def getsymbol(tree):
341 341 """Get symbol name from valid ``symbol`` in ``tree``
@@ -347,7 +347,7 b' def getsymbol(tree):'
347 347 def isvalidfunc(tree):
348 348 """Examine whether specified ``tree`` is valid ``func`` or not
349 349 """
350 return tree[0] == 'func' and len(tree) > 1 and isvalidsymbol(tree[1])
350 return tree[0] == 'func' and isvalidsymbol(tree[1])
351 351
352 352 def getfuncname(tree):
353 353 """Get function name from valid ``func`` in ``tree``
@@ -361,10 +361,7 b' def getfuncargs(tree):'
361 361
362 362 This assumes that ``tree`` is already examined by ``isvalidfunc``.
363 363 """
364 if len(tree) > 2:
365 return getlist(tree[2])
366 else:
367 return []
364 return getlist(tree[2])
368 365
369 366 def getset(repo, subset, x):
370 367 if not x:
@@ -2434,14 +2431,14 b' def _getalias(aliases, tree):'
2434 2431 """If tree looks like an unexpanded alias, return it. Return None
2435 2432 otherwise.
2436 2433 """
2437 if isinstance(tree, tuple) and tree:
2438 if tree[0] == 'symbol' and len(tree) == 2:
2434 if isinstance(tree, tuple):
2435 if tree[0] == 'symbol':
2439 2436 name = tree[1]
2440 2437 alias = aliases.get(name)
2441 2438 if alias and alias.args is None and alias.tree == tree:
2442 2439 return alias
2443 if tree[0] == 'func' and len(tree) > 1:
2444 if tree[1][0] == 'symbol' and len(tree[1]) == 2:
2440 if tree[0] == 'func':
2441 if tree[1][0] == 'symbol':
2445 2442 name = tree[1][1]
2446 2443 alias = aliases.get(name)
2447 2444 if alias and alias.args is not None and alias.tree == tree[:2]:
@@ -2452,7 +2449,7 b' def _expandargs(tree, args):'
2452 2449 """Replace _aliasarg instances with the substitution value of the
2453 2450 same name in args, recursively.
2454 2451 """
2455 if not tree or not isinstance(tree, tuple):
2452 if not isinstance(tree, tuple):
2456 2453 return tree
2457 2454 if tree[0] == '_aliasarg':
2458 2455 sym = tree[1]
General Comments 0
You need to be logged in to leave comments. Login now