# HG changeset patch # User Pierre-Yves David # Date 2017-03-15 22:11:52 # Node ID ac7aa96e4cd86a38ddbf1ac15345b3277108fc8f # Parent 2daeab02b4b13b4d4829c216fd0db39e9733ba0b filemerge: explicitly tests for None Changeset 758526333dec removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -36,7 +36,9 @@ def _toolbool(ui, tool, part, default=Fa return ui.configbool("merge-tools", tool + "." + part, default) def _toollist(ui, tool, part, default=None): - return ui.configlist("merge-tools", tool + "." + part, default or []) + if default is None: + default = [] + return ui.configlist("merge-tools", tool + "." + part, default) internals = {} # Merge tools to document.