# HG changeset patch # User Yuya Nishihara # Date 1456751448 -32400 # Node ID 0f59674dc9ffd2e336462c0013e15b5fbbc3b439 # Parent ee11167fe1da9ea8d931f703a8255251d5723434 revset: unindent codes in _getalias() function We generally do return early if tree isn't a tuple. diff -r ee11167fe1da -r 0f59674dc9ff mercurial/revset.py --- a/mercurial/revset.py Mon Feb 29 19:24:15 2016 +0900 +++ b/mercurial/revset.py Mon Feb 29 22:10:48 2016 +0900 @@ -2260,18 +2260,18 @@ """If tree looks like an unexpanded alias, return it. Return None otherwise. """ - if isinstance(tree, tuple): - if tree[0] == 'symbol': - name = tree[1] - alias = aliases.get(name) - if alias and alias.args is None and alias.tree == tree: - return alias - if tree[0] == 'func': - if tree[1][0] == 'symbol': - name = tree[1][1] - alias = aliases.get(name) - if alias and alias.args is not None and alias.tree == tree[:2]: - return alias + if not isinstance(tree, tuple): + return None + if tree[0] == 'symbol': + name = tree[1] + alias = aliases.get(name) + if alias and alias.args is None and alias.tree == tree: + return alias + if tree[0] == 'func' and tree[1][0] == 'symbol': + name = tree[1][1] + alias = aliases.get(name) + if alias and alias.args is not None and alias.tree == tree[:2]: + return alias return None def _expandargs(tree, args):