comparison mercurial/filemerge.py @ 31445:ac7aa96e4cd8

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
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 15 Mar 2017 15:11:52 -0700
parents 758526333dec
children 458f7294dfee
comparison
equal deleted inserted replaced
31444:2daeab02b4b1 31445:ac7aa96e4cd8
34 34
35 def _toolbool(ui, tool, part, default=False): 35 def _toolbool(ui, tool, part, default=False):
36 return ui.configbool("merge-tools", tool + "." + part, default) 36 return ui.configbool("merge-tools", tool + "." + part, default)
37 37
38 def _toollist(ui, tool, part, default=None): 38 def _toollist(ui, tool, part, default=None):
39 return ui.configlist("merge-tools", tool + "." + part, default or []) 39 if default is None:
40 default = []
41 return ui.configlist("merge-tools", tool + "." + part, default)
40 42
41 internals = {} 43 internals = {}
42 # Merge tools to document. 44 # Merge tools to document.
43 internalsdoc = {} 45 internalsdoc = {}
44 46