# HG changeset patch # User Mads Kiilerich # Date 1473694879 -7200 # Node ID 89a548ea164bdf3c9182b8c5395f6e73584d8b92 # Parent 9a523af15c9f9550a730f9db74070149a3fbdc12 utils: when building a Mercurial ui object with configuration, don't use 'None' for NULL values If Ui had an entry with ui_section='extensions', ui_key='largefiles', ui_value=NULL it would be passed to Mercurial as if the .ini file had [extensions] largefiles = None and it would fail to load the largefiles extension because it couldn't find './None/'. Note: get_current_revision might currently mask this problem. It will not get the Ui from the database and will thus read a normal .ini file from the system and (if configured) read the largefiles extension from the default location. That will make the largefiles extension available for later largefiles imports even if they specify the bogus path. As f8a714c2c5a1 noted in a FIXME: ui_value should perhaps not be nullable. For now, just handle NULL in extension configuration. diff -r 9a523af15c9f -r 89a548ea164b kallithea/lib/utils.py --- a/kallithea/lib/utils.py Mon Sep 12 17:41:19 2016 +0200 +++ b/kallithea/lib/utils.py Mon Sep 12 17:41:19 2016 +0200 @@ -358,8 +358,8 @@ hg_ui = ret for ui_ in hg_ui: if ui_.ui_active: - ui_val = safe_str(ui_.ui_value) - log.debug('settings ui from db: [%s] %s=%s', ui_.ui_section, + ui_val = '' if ui_.ui_value is None else safe_str(ui_.ui_value) + log.debug('settings ui from db: [%s] %s=%r', ui_.ui_section, ui_.ui_key, ui_val) baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key), ui_val)