# HG changeset patch # User Navaneeth Suresh # Date 1564814674 -19800 # Node ID 049b2ac3252e15a5bbfb5a4bec0ec88e0884603e # Parent 6957f7b93e034d881e84d0029e952ce6ebbdf38a config: remove pycompat.bytestr() for defaultvalue This is a follow-up patch to 51a2e3102db2. This removes `pycompat.bytestr` to preserve `None` in `commands.config()`. Differential Revision: https://phab.mercurial-scm.org/D6712 diff -r 6957f7b93e03 -r 049b2ac3252e mercurial/commands.py --- a/mercurial/commands.py Sat Jul 27 12:19:51 2019 +0530 +++ b/mercurial/commands.py Sat Aug 03 12:14:34 2019 +0530 @@ -1872,7 +1872,7 @@ for section, name, value in ui.walkconfig(untrusted=untrusted): source = ui.configsource(section, name, untrusted) value = pycompat.bytestr(value) - defaultvalue = pycompat.bytestr(ui.configdefault(section, name)) + defaultvalue = ui.configdefault(section, name) if fm.isplain(): source = source or 'none' value = value.replace('\n', '\\n') diff -r 6957f7b93e03 -r 049b2ac3252e tests/test-config.t --- a/tests/test-config.t Sat Jul 27 12:19:51 2019 +0530 +++ b/tests/test-config.t Sat Aug 03 12:14:34 2019 +0530 @@ -70,7 +70,7 @@ $ hg showconfig Section.KeY -Tjson [ { - "defaultvalue": "None", + "defaultvalue": null, "name": "Section.KeY", "source": "*.hgrc:*", (glob) "value": "Case Sensitive" @@ -103,7 +103,7 @@ $ hg config empty.source -Tjson [ { - "defaultvalue": "None", + "defaultvalue": null, "name": "empty.source", "source": "", "value": "value"