Mercurial > hg-stable
changeset 22191:9f9a2b79dcd7
annotate: rewrite long short-circuit statement by if-elif-else
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 15 Aug 2014 14:29:30 +0900 |
parents | 55308ab8117c |
children | d1823cdf8554 |
files | mercurial/context.py |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Tue Jun 24 17:27:18 2014 +0100 +++ b/mercurial/context.py Fri Aug 15 14:29:30 2014 +0900 @@ -777,9 +777,12 @@ size = len(text.splitlines()) return ([(rev, i) for i in xrange(1, size + 1)], text) - decorate = (((linenumber is None) and decorate_compat) or - (linenumber and with_linenumber) or - without_linenumber) + if linenumber is None: + decorate = decorate_compat + elif linenumber: + decorate = with_linenumber + else: + decorate = without_linenumber def pair(parent, child): blocks = mdiff.allblocks(parent[1], child[1], opts=diffopts,